pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <scott.marlowe@gmail.com>
To: Justin <justin@emproshunts.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: getting estimated cost to agree with actual
Date: Mon, 2 Jun 2008 17:38:21 -0600
Message-ID: <dcc563d10806021638t6619ef6cw67f2606541cd90f6@mail.gmail.com> (raw)
In-Reply-To: <4844696D.20307@emproshunts.com>
References: <4844696D.20307@emproshunts.com>

On Mon, Jun 2, 2008 at 3:43 PM, Justin <justin@emproshunts.com> wrote:
> As i've been looking over the more complicated queries that i have written
> and gotten allot of help in redoing the quires from you all, thanks again.
>
> I have noticed that  estimated Cost to do the query is way off from Actual.
>  The queries  don't run slow at least not to me. The Estimated Cost is way
> higher than the actual time on Hash joins but on the scan through the tables
> the Estimate Cost to  Actual flips where Actual is way higher than Estimated
> Cost
>
> I have tried increasing and decreasing the Stats on the important columns
> with no changes

Well, they're not measured in the same units.  estimated costs are in
terms of the cost to sequentially scan a single tuple, while actual
costs are in milliseconds.

You might be able to change the cost of sequential scan from 1 to
something else and everything else to reflect that change to get them
close.  But they aren't supposed to match directly up.



view thread (4+ messages)  latest in thread

Message-ID: <dcc563d10806021638t6619ef6cw67f2606541cd90f6@mail.gmail.com>
Permalink:  ../dcc563d10806021638t6619ef6cw67f2606541cd90f6@mail.gmail.com/
Also on:    postgresql.org/message-id/dcc563d10806021638t6619ef6cw67f2606541cd90f6@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-performance@postgresql.org
  Cc: scott.marlowe@gmail.com, justin@emproshunts.com
  Subject: Re: getting estimated cost to agree with actual
  In-Reply-To: <dcc563d10806021638t6619ef6cw67f2606541cd90f6@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