Re: Multi-pass planner

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Greg Stark <stark(at)mit(dot)edu>, decibel <decibel(at)decibel(dot)org>, Josh Berkus <josh(at)agliodbs(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Multi-pass planner
Date: 2013-04-19 21:49:20
Message-ID: CAMkU=1wHbx9ewFEMQxO8UXG2G2fsVQOc=_A57-2ZnhAE0PYftA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 4, 2013 at 11:53 AM, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>wrote:

> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> > for estimate_worstcase_fraction. So, when computing the cost of a
> > path, we'd compute our current expected-case estimate, and also a
> > worst-case estimate, and then compute the final cost as:
>
> There also was the idea for the executor to be able to handle alternate
> plans and some heuristic to determine that the actual cost of running a
> plan is much higher than what's been estimated, so much so as to switch
> to starting from scratch with the other plan instead.
>

Or even before it starts executing. If the planner realizes the stakes are
high enough, it could abandon its assumptions about how likely it is for a
block to be in cache, and go do a little sampling of the cache and see. To
be effective it would probably have to sample the OS cache as well as the
shared_buffers, which would certain complicate things and might not be
portable.

Of course right now there is no explicit estimate about the cache hit rate
at all, they are just implicitly built into other settings. So those would
probably need to be separated into true IO cost, and a default cache
estimate to used when sampling is not warranted.

Cheers,

Jeff

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2013-04-19 22:43:27 Re: Multi-pass planner
Previous Message Claudio Freire 2013-04-19 21:24:12 Re: Multi-pass planner