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 E36F011F6B2E for ; Wed, 12 Apr 2006 14:45:39 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -2.364 X-Spam-Level: X-Spam-Status: No, score=-2.364 required=5 tests=[AWL=0.100, BAYES_00=-2.599, FORGED_RCVD_HELO=0.135] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id x20Jh2zgikSP for ; Wed, 12 Apr 2006 14:45:36 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from moonunit2.moonview.localnet (wsip-68-15-5-150.sd.sd.cox.net [68.15.5.150]) by postgresql.org (Postfix) with ESMTP id 9492511F6B06 for ; Wed, 12 Apr 2006 14:45:35 -0300 (ADT) Received: from [192.168.0.3] (moonunit3.moonview.localnet [192.168.0.3]) by moonunit2.moonview.localnet (8.13.1/8.13.1) with ESMTP id k3CHjZO3028658; Wed, 12 Apr 2006 10:45:36 -0700 Message-ID: <443D3A9C.40106@modgraph-usa.com> Date: Wed, 12 Apr 2006 10:36:28 -0700 From: "Craig A. James" User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Jim C. Nasby" CC: PFC , Michael Glaesemann , Rodrigo Sakai , pgsql-performance@postgresql.org Subject: Re: FOREIGN KEYS vs PERFORMANCE References: <001301c65d9c$08884ef0$4700a8c0@TREEZANTHUS> <72C39159-1A4B-4595-A978-1DF57AD42527@myrealbox.com> <443D127D.2070601@modgraph-usa.com> <20060412153951.GH49405@pervasive.com> In-Reply-To: <20060412153951.GH49405@pervasive.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200604/270 X-Sequence-Number: 18354 Jim C. Nasby wrote: >>1. You have only one application that modifies the data. (Otherwise, you >>have to duplicate the rules across many applications, leading to a >>code-maintenance nightmare). > > You forgot something: > > 1a: You know that there will never, ever, ever, ever, be any other > application that wants to talk to the database. > > I know tons of people that get burned because they go with something > that's "good enough for now", and then regret that decision for years to > come. No, I don't agree with this. Too many people waste time designing for "what if..." scenarios that never happen. You don't want to be dumb and design something that locks out a foreseeable and likely future need, but referential integrity doesn't meet this criterion. There's nothing to keep you from changing from app-managed to database-managed referential integrity if your needs change. Design for your current requirements. Let us be of good cheer, remembering that the misfortunes hardest to bear are those which never happen. - James Russell Lowell (1819-1891) Therefore do not be anxious about tomorrow, for tomorrow will be anxious for itself. Let the day's own trouble be sufficient for the day. - Matthew 6:34 Craig