Re: Explain not accurate

From: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
To: Richard van den Berg <richard(dot)vandenberg(at)trust-factory(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Explain not accurate
Date: 2004-01-11 19:55:00
Message-ID: Pine.LNX.4.44.0401112050470.13405-100000@zigo.dhs.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, 9 Jan 2004, Richard van den Berg wrote:

> problems. However, I've run into an issue where explain tells us a the
> costs of a quiry are tremendous (105849017586), but the query actually
> runs quite fast. Even "explain analyze" shows these costs.

It would be helpful if you can show the query and the EXPLAIN ANALYZE of
the query (and not just EXPLAIN).

> This makes me wonder: can the estimates explain shows be dead wrong?

Of course they can. An estimation is just an estimation. If you have not
analyzed the database then it's most likely wrong. Dead wrong is not
common, but not impossible.

Run VACUUM ANALYZE and see if the estimate is better after that.

--
/Dennis Björklund

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message CoL 2004-01-11 20:01:18 Re: COUNT & Pagination
Previous Message David Shadovitz 2004-01-11 18:10:52 COUNT & Pagination