X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 78B4511F6611 for ; Tue, 11 Apr 2006 20:38:39 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 0.51 X-Spam-Level: X-Spam-Status: No, score=0.51 required=5 tests=[AWL=0.510] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 5Hei4ifxS7I6 for ; Tue, 11 Apr 2006 20:38:27 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 5826D11F65B3 for ; Tue, 11 Apr 2006 20:38:36 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 28B9856427; Tue, 11 Apr 2006 18:38:21 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Tue, 11 Apr 2006 18:38:20 -0500 Date: Tue, 11 Apr 2006 18:38:20 -0500 From: "Jim C. Nasby" To: Michael Glaesemann Cc: Rodrigo Sakai , pgsql-performance@postgresql.org Subject: Re: FOREIGN KEYS vs PERFORMANCE Message-ID: <20060411233820.GB49405@pervasive.com> References: <001301c65d9c$08884ef0$4700a8c0@TREEZANTHUS> <72C39159-1A4B-4595-A978-1DF57AD42527@myrealbox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <72C39159-1A4B-4595-A978-1DF57AD42527@myrealbox.com> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060411:grzm@myrealbox.com::kT7TVqH3MCb6vd9F:0000000000000000000 0000000000000000000000004VoI X-Hashcash: 1:20:060411:rodrigo.sakai@zanthus.com.br::f3yGTUM6VWMmP62H:000000000 000000000000000000000000095p X-Hashcash: 1:20:060411:pgsql-performance@postgresql.org::i1Kji4pFt7Puz1l1:00000 0000000000000000000000004Y6c X-Archive-Number: 200604/254 X-Sequence-Number: 18338 On Wed, Apr 12, 2006 at 08:06:17AM +0900, Michael Glaesemann wrote: > > On Apr 12, 2006, at 4:13 , Rodrigo Sakai wrote: > > > I think this is an old question, but I want to know if it really > >is well worth to not create some foreign keys an deal with the > >referential integrity at application-level????? > > If I had to choose between one or the other, I'd leave all > referential integrity in the database and deal with the errors thrown > when referential integrity is violated in the application. PostgreSQL > is designed to handle these kinds of issues. 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. -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461