Re: Foreign key triggers

From: Adam Brusselback <adambrusselback(at)gmail(dot)com>
To: Roberto Balarezo <roberto(dot)balarezo(at)fit-bank(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Foreign key triggers
Date: 2016-05-14 17:33:16
Message-ID: CAMjNa7cc=B8hqRKEki6_7DN7UYuqAstOqDTnw9jaGy7WhE8zmQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yes, foreign keys are implemented using triggers. Here is a blog post
explaining a little more:
http://bonesmoses.org/2014/05/14/foreign-keys-are-not-free/

I would assume it's still got to do a seq scan even on every referencing
table even if it's empty for every record since there are no indexes. It
is not free to do ~25k seq scans on that many tables.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Boszormenyi Zoltan 2016-05-14 19:58:48 PG wire protocol question
Previous Message Jeff Janes 2016-05-14 17:13:16 Re: index on ILIKE/LIKE - PostgreSQL 9.2