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 5270352868 for ; Fri, 20 May 2005 20:06:33 -0300 (ADT) 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 20885-07 for ; Fri, 20 May 2005 23:06:32 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id AAD3852859 for ; Fri, 20 May 2005 20:06:30 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j4KN6pMx004416; Fri, 20 May 2005 19:06:51 -0400 (EDT) To: "Jim C. Nasby" Cc: Josh Berkus , pgsql-performance@postgresql.org, testperf-general@pgfoundry.org Subject: Re: Tuning planner cost estimates In-reply-to: <20050520224055.GM44623@decibel.org> References: <20050518002236.GU30902@decibel.org> <200505190931.47662.josh@agliodbs.com> <20050520202017.GK44623@decibel.org> <28982.1116622058@sss.pgh.pa.us> <20050520224055.GM44623@decibel.org> Comments: In-reply-to "Jim C. Nasby" message dated "Fri, 20 May 2005 17:40:55 -0500" Date: Fri, 20 May 2005 19:06:51 -0400 Message-ID: <4415.1116630411@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/339 X-Sequence-Number: 12503 "Jim C. Nasby" writes: > Does this sound like a reasonable approach? Also, how important do > people think it is to use explain analyze output instead of just doing > SELECT count(*) FROM (query you actually want to test)? (The select > count(*) wrapper is just a means to throw away the results since we > don't really want to worry about data transfer times, etc). The testing > I've done (http://stats.distributed.net/~decibel/base.log) shows explain > analyze to be almost 5x slower than select count(*), so it seems a big > gain if we can avoid that. I'd go with the select count(*) --- I can't imagine that we will be trying to model the behavior of anything so complex that we really need explain analyze output. (On the other hand, recording explain output is a good idea to make sure you are testing what you think you are testing.) Actually, it might be worth using "select count(null)", which should avoid the calls to int8inc. I think this doesn't matter so much in CVS tip, but certainly in existing releases the palloc overhead involved is noticeable. BTW, 5x is an awful lot; I've not noticed overheads more than about 2x. regards, tom lane