Re: Spotting planner errors (was Re: Query planner is using

From: Richard Huxton <dev(at)archonet(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Brian Herlihy <btherl(at)yahoo(dot)com(dot)au>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Spotting planner errors (was Re: Query planner is using
Date: 2006-04-07 15:24:56
Message-ID: 44368448.9090101@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Tom Lane wrote:
> Richard Huxton <dev(at)archonet(dot)com> writes:
>> Tom - does the planner/executor know it's got row estimates wrong? That
>> is, if I'm not running an EXPLAIN ANALYSE is there a point at which we
>> could log "planner estimate for X out by factor of Y"?
>
> Not at the moment, but you could certainly imagine changing the executor
> to count rows even without EXPLAIN ANALYZE, and then complain during
> plan shutdown.
>
> Not sure how helpful that would be; there would be a lot of noise from
> common cases such as executing underneath a LIMIT node.

Hmm - thinking about it you'd probably want to record it similarly to
stats too. It's the fact that the planner *repeatedly* gets an estimate
wrong that's of interest.

Would it be prohibitive to total actions taken - to act as raw data for
random_page_cost / cpu_xxx_cost? If you could get a ratio of estimated
vs actual time vs the various page-fetches/index-fetches etc. we could
actually plug some meaningful numbers in.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2006-04-07 15:25:14 Re: Loading the entire DB into RAM
Previous Message Tom Lane 2006-04-07 15:12:52 Re: Spotting planner errors (was Re: Query planner is using wrong index.)