pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: James Shaw <js102@zepler.net>
To: pgsql-docs@postgresql.org
Subject: Re: Possible mistake in 'Using EXPLAIN' section
Date: Mon, 22 Oct 2007 13:14:37 +0100
Message-ID: <c4a5ac250710220514l33976968l2eb819b29e6e7d07@mail.gmail.com> (raw)
In-Reply-To: <c4a5ac250710100551y51a93372u22e2eba612faf164@mail.gmail.com>
References: <c4a5ac250710100406j51c34512k47ef125c32c6f910@mail.gmail.com>
	<13020.1192018254@sss.pgh.pa.us>
	<c4a5ac250710100551y51a93372u22e2eba612faf164@mail.gmail.com>

On 10/10/2007, James Shaw <js102@zepler.net> wrote:
>
> On 10/10/2007, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > "James Shaw" <js102@zepler.net> writes:
> > > The example given has "Seq Scan on tenk1 (cost=0.00..458.00" in the
> example,
> > > but then says, "you will find out that tenk1 has 358 disk pages" and
> "the
> > > cost is estimated at 358 page reads".  Shouldn't this be 458 disk page
> > > reads?
> >
> > No.  Why did you stop reading in mid-sentence?
>
> I'm sorry, I misunderstood.  I've reread, and understand where the
> extra 100 comes from now.  Perhaps this could be reworded:
>
> This is about as straightforward as it gets.  If you do
> SELECT relpages, reltuples FROM pg_class WHERE relname = 'tenk1';
>
> you will find out that tenk1 has 358 disk pages and 10000 rows.  The
> estimated cost is (disk pages read * seq_page_cost) + (number of rows
> read * cpu_tuple_cost).  By default, seq_page_cost is 1.0 and
> cpu_tuple_cost is 0.01.  Therefore, the estimated cost is (358 * 1.0)
> + (10000 * 0.01) = 458.


Were there any thoughts on this?  I was hoping this might be included in the
manual, since I felt it was somewhat clearer.

James

view thread (6+ messages)  latest in thread

Message-ID: <c4a5ac250710220514l33976968l2eb819b29e6e7d07@mail.gmail.com>
Permalink:  ../c4a5ac250710220514l33976968l2eb819b29e6e7d07@mail.gmail.com/
Also on:    postgresql.org/message-id/c4a5ac250710220514l33976968l2eb819b29e6e7d07@mail.gmail.com

 · 

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-docs@postgresql.org
  Cc: js102@zepler.net
  Subject: Re: Possible mistake in 'Using EXPLAIN' section
  In-Reply-To: <c4a5ac250710220514l33976968l2eb819b29e6e7d07@mail.gmail.com>

* 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