Re: FOREIGN KEYS vs PERFORMANCE - Mailing list pgsql-performance

From Tom Lane
Subject Re: FOREIGN KEYS vs PERFORMANCE
Date
Msg-id 13087.1144810603@sss.pgh.pa.us
Whole thread Raw
In response to Re: FOREIGN KEYS vs PERFORMANCE  ("Jim C. Nasby" <jnasby@pervasive.com>)
List pgsql-performance
"Jim C. Nasby" <jnasby@pervasive.com> writes:
> On Wed, Apr 12, 2006 at 08:06:17AM +0900, Michael Glaesemann wrote:
>> ... Anything you code in
>> your application is more likely to contain bugs or miss corner cases
>> that would allow referential integrity to be violated. PostgreSQL has
>> been pounded on for years by a great many users and developers,
>> making the likelihood of bugs still remaining much smaller.

> It's also pretty unlikely that you can make RI in the application
> perform better than in the database.

I think the traditional assumption among the "you should do RI in the
application" crowd is that the application has higher-level knowledge
that lets it understand when it can skip doing an RI check entirely.
Skipping an RI check is always faster than doing it --- so that's right,
it's faster.  As long as you don't make any mistakes.

The question you have to ask yourself is whether you are really that
smart ... not just today, but every single time.  To quote Clint
Eastwood: "Do you feel lucky punk?  Well, do you?"

            regards, tom lane

pgsql-performance by date:

Previous
From: Christopher Kings-Lynne
Date:
Subject: Re: Restore performance?
Next
From: PFC
Date:
Subject: Re: pgmemcache