X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 38933D1B917 for ; Thu, 12 Feb 2004 16:05:51 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 73095-05 for ; Thu, 12 Feb 2004 12:05:42 -0400 (AST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr1.postgresql.org (Postfix) with ESMTP id 9A856D1B4DA for ; Thu, 12 Feb 2004 12:05:42 -0400 (AST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id ECAF135017; Thu, 12 Feb 2004 08:04:53 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id EB47634D58; Thu, 12 Feb 2004 08:04:53 -0800 (PST) Date: Thu, 12 Feb 2004 08:04:53 -0800 (PST) From: Stephan Szabo To: ow Cc: pgsql-sql@postgresql.org Subject: Re: 7.4 - FK constraint performance In-Reply-To: <20040212155351.34740.qmail@web60801.mail.yahoo.com> Message-ID: <20040212080217.A87422@megazone.bigpanda.com> References: <20040212155351.34740.qmail@web60801.mail.yahoo.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/116 X-Sequence-Number: 16807 On Thu, 12 Feb 2004, ow wrote: > --- Stephan Szabo wrote: > > You also did the alter table to up the statistics target on the column, > > right? > > Not really. I did not change the the default stats settings in the > postgresql.conf. Not sure what needs to be changed, can you clarify? Basically, run something like: -- 1000 is just an arbitrary choice, but we can lower it later if this -- works. ALTER TABLE my.Large ALTER COLUMN small_id SET STATISTICS 1000; ANALYZE my.Large; This increases the target for just the column in question which means it should have a better idea of the distribution and may make it make a better guess if you've got a somewhat uneven distribution.