X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 67287D1DD2C for ; Tue, 13 Apr 2004 14:55:52 -0300 (ADT) 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 18160-06 for ; Tue, 13 Apr 2004 14:55:51 -0300 (ADT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 2AAE6D1DC7D for ; Tue, 13 Apr 2004 14:55:50 -0300 (ADT) 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 i3DHtnBn024671; Tue, 13 Apr 2004 13:55:50 -0400 (EDT) To: jdunn@autorevenue.com Cc: "'Postgresql Performance'" Subject: Re: index v. seqscan for certain values In-reply-to: <000801c42165$68a67750$4f01a8c0@jeremydunn> References: <000801c42165$68a67750$4f01a8c0@jeremydunn> Comments: In-reply-to "Jeremy Dunn" message dated "Tue, 13 Apr 2004 10:41:30 -0400" Date: Tue, 13 Apr 2004 13:55:49 -0400 Message-ID: <24670.1081878949@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/149 X-Sequence-Number: 6449 "Jeremy Dunn" writes: > Interestingly, I tried increasing the stat size for the CID column to > 2000, analyzing, and checking the accuracy of the stats again. There's a hard limit of 1000, I believe. Didn't it give you a warning saying so? At 1000 the ANALYZE sample size would be 300000 rows, or about a quarter of your table. I would have thought this would give frequency estimates with much better precision than you seem to be seeing --- but my statistics are rusty enough that I'm not sure about it. Possibly the nonuniform clumping of CID has something to do with the poor results. Any stats majors on the list? regards, tom lane