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 03CE3D1DA83 for ; Fri, 13 Feb 2004 04:50:04 +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 37537-08 for ; Fri, 13 Feb 2004 00:49:57 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id EA9D0D1D299 for ; Fri, 13 Feb 2004 00:49:56 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i1D4nuBM027697; Thu, 12 Feb 2004 23:49:56 -0500 (EST) To: ow Cc: pgsql-sql@postgresql.org Subject: Re: 7.4 - FK constraint performance In-reply-to: <20040213012253.64419.qmail@web60807.mail.yahoo.com> References: <20040213012253.64419.qmail@web60807.mail.yahoo.com> Comments: In-reply-to ow message dated "Thu, 12 Feb 2004 17:22:53 -0800" Date: Thu, 12 Feb 2004 23:49:56 -0500 Message-ID: <27696.1076647796@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/131 X-Sequence-Number: 16822 ow writes: > --- Tom Lane wrote: >> Can't see how we optimize your case without pessimizing more-common cases. > I think other RDBMSs simply use preset value instead of partial table > scan when there's not enough stat info. Might be a better way. The problem here cannot be described as "not enough stat info". The available stats are complete and they point very strongly to the conclusion that searches in the large table should be seqscans. To do otherwise would be folly in general, even if it happens to be the correct thing in this particular example. regards, tom lane