public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Fuhr <[email protected]>
To: Bruno Wolff III <[email protected]>
To: [email protected]
Subject: Re: Possible copy error in explain example
Date: Mon, 11 Apr 2005 22:34:21 -0600
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

On Mon, Apr 11, 2005 at 11:40:01PM -0500, Bruno Wolff III wrote:
> I was looking at:
> http://candle.pha.pa.us/main/writings/pgsql/sgml/performance-tips.html
> 
> And noticed in the first example that it is claimed the cost estimate
> is 233 disk block reads. However, "233" doesn't appear in the explain
> output shown. I think that "233" is supposed to match the "333" in
> the explain output, but I am not 100% sure.

This part?

  This is about as straightforward as it gets.  If you do

    SELECT * FROM pg_class WHERE relname = 'tenk1';

  you will find out that tenk1 has 233 disk pages and 10000 rows.
  So the cost is estimated at 233 page reads, defined as costing
  1.0 apiece, plus 10000 * cpu_tuple_cost which is currently 0.01
  (try SHOW cpu_tuple_cost).

Doesn't that work out to

  (233 * 1.0) + (10000 * 0.01) = 233.0 + 100.0 = 333.0

or am I missing something?

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/



view thread (3+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Possible copy error in explain example
  In-Reply-To: <[email protected]>

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

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