Re: Multi-pass planner

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, decibel <decibel(at)decibel(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Multi-pass planner
Date: 2009-08-20 17:31:56
Message-ID: 407d949e0908201031p1f382d8ag6053a9302eb29501@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 20, 2009 at 6:28 PM, Greg Stark<gsstark(at)mit(dot)edu> wrote:
> I don't think it's a bad idea, I just think you have to set your
> expectations pretty low. If the estimates are bad there isn't really
> any plan that will be guaranteed to run quickly.

Actually this is usually Tom's point when this topic comes up. Say
you're deciding between an index scan and a sequential scan. The
sequential scan has a total cost of 1000..1000 but the index scan has
an estimated total cost of 1..10000. If you pick the sequential scan
you might be running 1000x slower than the index scan in the worst
case. But if you pick the index scan you might be running 10x slower
than the sequential scan in the worst case. If you don't trust the
estimate where does that leave you? Making a mistake either way is
fatal.

--
greg
http://mit.edu/~gsstark/resume.pdf

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2009-08-20 18:16:53 Re: Multi-pass planner
Previous Message Greg Stark 2009-08-20 17:28:32 Re: Multi-pass planner