Re: Transient plans versus the SPI API

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Transient plans versus the SPI API
Дата
Msg-id 22031.1312400017@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Transient plans versus the SPI API  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: Transient plans versus the SPI API  (Simon Riggs <simon@2ndQuadrant.com>)
Re: Transient plans versus the SPI API  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Список pgsql-hackers
Simon Riggs <simon@2ndQuadrant.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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Transient plans versus the SPI API
Следующее
От: Tom Lane
Дата:
Сообщение: Re: mosbench revisited