X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id D7F0ED1B8CD for ; Thu, 28 Aug 2003 18:22:53 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 65798-07 for ; Thu, 28 Aug 2003 15:22:23 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id C07A1D1B8BC for ; Thu, 28 Aug 2003 15:22:22 -0300 (ADT) Received: from news.hub.org (host-64-117-224-194.altec1.com [64.117.224.194] (may be forged)) by news.hub.org (8.12.9/8.12.9) with ESMTP id h7SIMMek087739 for ; Thu, 28 Aug 2003 18:22:22 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h7SHsd2S079486 for pgsql-performance@postgresql.org; Thu, 28 Aug 2003 17:54:39 GMT From: teknokrat X-Newsgroups: comp.databases.postgresql.performance Subject: Re: performance of foreign key constraints Date: Thu, 28 Aug 2003 18:54:40 +0100 Organization: Hub.Org Networking Services Lines: 25 Message-ID: References: <20030828102646.Q9762-100000@megazone.bigpanda.com> Reply-To: teknokrat@yahoo.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0+) Gecko/20020518 X-Accept-Language: en-us, en, ko In-Reply-To: <20030828102646.Q9762-100000@megazone.bigpanda.com> To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/430 X-Sequence-Number: 3246 Stephan Szabo wrote: > On Thu, 28 Aug 2003, teknokrat wrote: > > >>I have a table that has about 20 foreign key constraints on it. I think >>this is a bit excessive and am considering removing them ( they are all >>related to the same table and I don't think there is much chance of any >>integrity violations ). Would this improve performance or not? > > > It depends on your frequency of inserts/updates to the table with the > constraint and the frequency of update/delete to the table(s) being > refered to. My guess is probably. You may wish to leave some of the > constraints (decide which are the most important), but 20 does seem a bit > excessive in general. > The references are all to the same table i.e. they are employee ids, so leaving some and not others would make no sense. The table has no deletes, small amount of inserts and moderate amount of updates. However there are many selects and its their performance I am most concerned with. thanks