pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jim C. Nasby <jnasby@pervasive.com>
Cc: Michael Glaesemann <grzm@myrealbox.com>
Cc: Rodrigo Sakai <rodrigo.sakai@zanthus.com.br>
Cc: pgsql-performance@postgresql.org
Subject: Re: FOREIGN KEYS vs PERFORMANCE
Date: Tue, 11 Apr 2006 22:56:43 -0400
Message-ID: <13087.1144810603@sss.pgh.pa.us> (raw)
In-Reply-To: <20060411233820.GB49405@pervasive.com>
References: <001301c65d9c$08884ef0$4700a8c0@TREEZANTHUS>
	<72C39159-1A4B-4595-A978-1DF57AD42527@myrealbox.com>
	<20060411233820.GB49405@pervasive.com>

"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



view thread (19+ messages)  latest in thread

Message-ID: <13087.1144810603@sss.pgh.pa.us>
Permalink:  ../13087.1144810603@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13087.1144810603@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jnasby@pervasive.com, grzm@myrealbox.com, rodrigo.sakai@zanthus.com.br
  Subject: Re: FOREIGN KEYS vs PERFORMANCE
  In-Reply-To: <13087.1144810603@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox