X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id D336911F676B for ; Wed, 12 Apr 2006 12:36:31 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -1.22 X-Spam-Level: X-Spam-Status: No, score=-1.22 required=5 tests=[AWL=1.379, BAYES_00=-2.599] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id FOrtFIfLFRhi for ; Wed, 12 Apr 2006 12:36:23 -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 7DDA111F6676 for ; Wed, 12 Apr 2006 12:36:23 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 4696056435; Wed, 12 Apr 2006 10:36:22 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Wed, 12 Apr 2006 10:36:20 -0500 Date: Wed, 12 Apr 2006 10:36:20 -0500 From: "Jim C. Nasby" To: PFC Cc: Michael Glaesemann , Rodrigo Sakai , pgsql-performance@postgresql.org Subject: Re: FOREIGN KEYS vs PERFORMANCE Message-ID: <20060412153619.GG49405@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: 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:060412:lists@peufeu.com::UfzQdRcOfRR5UwCm:00lpX X-Hashcash: 1:20:060412:grzm@myrealbox.com::bKjnMnlhosp3v+ui:0000000000000000000 0000000000000000000000008iEJ X-Hashcash: 1:20:060412:rodrigo.sakai@zanthus.com.br::JYZ9iVIXU6dh0Y3O:000000000 0000000000000000000000000HDV X-Hashcash: 1:20:060412:pgsql-performance@postgresql.org::kDOK0DhruzYVvIn/:00000 0000000000000000000000008r37 X-Archive-Number: 200604/268 X-Sequence-Number: 18352 On Wed, Apr 12, 2006 at 09:22:52AM +0200, PFC 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????? > > Trust me : do it in the application and you'll enter a world of > hurt. I'm doing it with some mysql apps, and it's a nightmare ; doing > cascaded delete's by hand, etc, you always forget something, you have to > modify a million places in your code everytime you add a new table, your > ORM bloats, you get to write cleanup cron scripts which take forever to > run, your website crashes etc. Well, yeah, thats typical for MySQL sites, but what's that have to do with RI? Sorry, couldn't resist. :P