Re: getting estimated cost to agree with actual

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: Justin <justin(at)emproshunts(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: getting estimated cost to agree with actual
Date: 2008-06-02 23:38:21
Message-ID: dcc563d10806021638t6619ef6cw67f2606541cd90f6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, Jun 2, 2008 at 3:43 PM, Justin <justin(at)emproshunts(dot)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.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Gregory Stark 2008-06-03 01:20:10 Re: getting estimated cost to agree with actual
Previous Message Justin 2008-06-02 21:43:09 getting estimated cost to agree with actual