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 8CB94D1B51C for ; Thu, 11 Sep 2003 03:08:16 +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 31817-03 for ; Thu, 11 Sep 2003 00:08:06 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id ED342D1B4EC for ; Thu, 11 Sep 2003 00:08:05 -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 h8B385sl096023 for ; Thu, 11 Sep 2003 03:08:05 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h8B37cJQ095870 for pgsql-performance@postgresql.org; Thu, 11 Sep 2003 03:07:38 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: Re: [osdldbt-general] Re: [GENERAL] how to get accurate Date: Wed, 10 Sep 2003 23:07:12 -0400 Organization: cbbrowne Computing Inc Lines: 49 Message-ID: References: <200309101944.h8AJiod26547@candle.pha.pa.us> <1063239434.14271.8130.camel@ibm-e.pdx.osdl.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org X-message-flag: Outlook is rather hackable, isn't it? X-Home-Page: http://www.cbbrowne.com/info/ X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) Cancel-Lock: sha1:4iS0BwP2jd0/DRDnldjk8arSL8M= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/185 X-Sequence-Number: 3551 The world rejoiced as maryedie@osdl.org (Mary Edie Meredith) wrote: > We tried 1000 as the default and found that the plans were good > plans and were consistent, but the pg_statistics was not exactly the > same. > > We took Tom's' advice and tried SET SEED=0 (actually select setseed > (0) ). When you're trying to get strict replicability of results, setting the seed to some specific value is necessary. Some useful results could be attained by varying the seed, and seeing how the plans change. > We did runs last night on our project machine which produced > consistent pg_statistics data and (of course) the same plans. > We will next try runs where we vary the default buckets. Other than > 10 and 1000, what numbers would you like us to try besides. > Previously the number 100 was mentioned. Are there others? That presumably depends on what your goal is. A useful experiment would be to see at what point (e.g. - at what bucket size) plans tend to "settle down" to the right values. It might well be that defaulting to 23 buckets (I'm picking that out of thin air) would cause the plans to typically be stable whatever seed got used. A test for this would be to, for each bucket size value, repeatedly ANALYZE and check query plans. At bucket size 10, you have seen the query plans vary quite a bit. At 1000, they seem to stabilize very well. The geometric centre, between 10 and 1000, is 100, so it would surely be useful to see if query plans are stable at that bucket size. The most interesting number to know would be the lowest number of buckets at which query plans are nearly always stable. Supposing that number was 23 (the number I earlier pulled out of the air), then that can be used as evidence that the default value for SET STATISTICS should be changed from 10 to 23. -- wm(X,Y):-write(X),write('@'),write(Y). wm('aa454','freenet.carleton.ca'). http://www3.sympatico.ca/cbbrowne/nonrdbms.html Sturgeon's Law: 90% of *EVERYTHING* is crud.