Re: Transient plans versus the SPI API

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Transient plans versus the SPI API
Date: 2011-08-03 19:33:37
Message-ID: 22031.1312400017@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
> I think its possible to tell automatically whether we need to replan
> always or not based upon the path we take through selectivity
> functions.

I don't really believe that, or at least I think it would only detect a
few cases. Examples of parameter-value-sensitive decisions that are
made nowhere near the selectivity functions are constraint exclusion and
LIKE pattern to index-qual conversion. And in none of these cases do we
really know at the bottom level whether a different parameter value will
lead to a significant change in the finished plan. For instance, if
there's no index for column foo, it is a waste of time to force
replanning just because we have varying selectivity estimates for
"WHERE foo > $1".

I think we'll be a lot better off with the framework discussed last
year: build a generic plan, as well as custom plans for the first few
sets of parameter values, and then observe whether there's a significant
reduction in estimated costs for the custom plans.

But in any case, it's way premature to be debating this until we have
the infrastructure in which we can experiment with different policies.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-08-03 19:38:50 Re: mosbench revisited
Previous Message Robert Haas 2011-08-03 19:33:09 Re: Transient plans versus the SPI API