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 89298D1B52B for ; Wed, 10 Sep 2003 19:45:13 +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 61023-03 for ; Wed, 10 Sep 2003 16:45:03 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id B9AFFD1B522 for ; Wed, 10 Sep 2003 16:45:00 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h8AJiod26547; Wed, 10 Sep 2003 15:44:50 -0400 (EDT) From: Bruce Momjian Message-Id: <200309101944.h8AJiod26547@candle.pha.pa.us> Subject: Re: [GENERAL] how to get accurate values in pg_statistic (continued) In-Reply-To: <11537.1062717375@sss.pgh.pa.us> To: Tom Lane Date: Wed, 10 Sep 2003 15:44:50 -0400 (EDT) Cc: Mary Edie Meredith , pgsql-performance , osdldbt-general X-Mailer: ELM [version 2.4ME+ PL106 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/176 X-Sequence-Number: 3542 Tom Lane wrote: > Mary Edie Meredith writes: > > Stephan Szabo kindly responded to our earlier queries suggesting we look > > at default_statistics_target and ALTER TABLE ALTER COLUMN SET > > STATISTICS. > > > These determine the number of bins in the histogram for a given column. > > But for a large number of rows (for example 6 million) the maximum value > > (1000) does not guarantee that ANALYZE will do a full scan of the table. > > We do not see a way to guarantee the same statistics run to run without > > forcing ANALYZE to examine every row of every table. > > Do you actually still have a problem with the plans changing when the > stats target is above 100 or so? I think the notion of "force ANALYZE > to do a full scan" is inherently wrongheaded ... it certainly would not > produce numbers that have anything to do with ordinary practice. > > If you have data statistics that are so bizarre that the planner still > gets things wrong with a target of 1000, then I'd like to know more > about why. Has there been any progress in determining if the number of default buckets (10) is the best value? -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073