pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Brian Herlihy <btherl@yahoo.com.au>
Cc: pgsql-performance@postgresql.org
Subject: Re: Spotting planner errors (was Re: Query planner is using
Date: Fri, 07 Apr 2006 16:24:56 +0100
Message-ID: <44368448.9090101@archonet.com> (raw)
In-Reply-To: <12067.1144422772@sss.pgh.pa.us>
References: <20060407064108.49532.qmail@web52315.mail.yahoo.com>
	<11739.1144420493@sss.pgh.pa.us>
	<4436805A.1040507@archonet.com>
	<12067.1144422772@sss.pgh.pa.us>

Tom Lane wrote:
> Richard Huxton <dev@archonet.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



view thread (3+ messages)

Message-ID: <44368448.9090101@archonet.com>
Permalink:  ../44368448.9090101@archonet.com/
Also on:    postgresql.org/message-id/44368448.9090101@archonet.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: dev@archonet.com, tgl@sss.pgh.pa.us, btherl@yahoo.com.au
  Subject: Re: Spotting planner errors (was Re: Query planner is using
  In-Reply-To: <44368448.9090101@archonet.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