pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jim C. Nasby <decibel@decibel.org>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-performance@postgresql.org
Cc: testperf-general@pgfoundry.org
Subject: Re: Tuning planner cost estimates
Date: Fri, 20 May 2005 19:06:51 -0400
Message-ID: <4415.1116630411@sss.pgh.pa.us> (raw)
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>

"Jim C. Nasby" <decibel@decibel.org> 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



view thread (11+ messages)  latest in thread

Message-ID: <4415.1116630411@sss.pgh.pa.us>
Permalink:  ../4415.1116630411@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4415.1116630411@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, decibel@decibel.org, josh@agliodbs.com, testperf-general@pgfoundry.org
  Subject: Re: Tuning planner cost estimates
  In-Reply-To: <4415.1116630411@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox