X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C5700568C3 for ; Mon, 21 Mar 2005 17:51:36 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 76074-04 for ; Mon, 21 Mar 2005 17:51:35 +0000 (GMT) Received: from davinci.ethosmedia.com (server227.ethosmedia.com [209.128.84.227]) by svr1.postgresql.org (Postfix) with ESMTP id C063E568B0 for ; Mon, 21 Mar 2005 17:51:34 +0000 (GMT) X-EthosMedia-Virus-Scanned: no infections found Received: from [63.195.55.98] (account josh@agliodbs.com HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 7151238; Mon, 21 Mar 2005 09:53:24 -0800 From: Josh Berkus Organization: Aglio Database Solutions To: "Tambet Matiisen" Subject: Re: What about utility to calculate planner cost constants? Date: Mon, 21 Mar 2005 09:51:06 -0800 User-Agent: KMail/1.6.2 Cc: References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200503210951.06044.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.011 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/420 X-Sequence-Number: 11125 Tambet, > I was following the cpu_tuple_cost thread and wondering, if it could be > possible to make PQA style utility to calculate configuration-specific > values for planner cost constants. It could make use of output of > log_(statement|parser|planner|executor)_stats, tough I'm not sure if the > output contains anything useful for those purposes. Yeah, that's something I need to look at. > Otherwise it could just collect statements, run EXPLAIN ANALYZE for all > of them and then play with planner cost constants to get the estimated > values as close as possible to actual values. Something like Goal Seek > in Excel, if you pardon my reference to MS :). That's not really practical. There are currently 5 major query tuning parameters, not counting the memory adjustments which really can't be left out. You can't realistically test all combinations of 6 variables. > Somewhat similar project seems to be pgautotune from pgFoundry, but it > only considers shared_buffers, sort_mem and vacuum_mem. And it seems to > use synthetic data instead of actual database and actual statements from > log. And it has been inactive for a while. Yeah, pg_autotune is a dead project. Once we got OSDL able to run tests, we came up with some rules-of-thumb which are more useful than autotune's output. More importantly, the approach doesn't scale to the 15-20 GUCs which we'd realistically want to test. -- Josh Berkus Aglio Database Solutions San Francisco