Re: functions: VOLATILE performs better than STABLE

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: functions: VOLATILE performs better than STABLE
Дата
Msg-id CAKJS1f8QwuNP9anQbPwcr4RLDR3JvW31c3L_H95tpn9HB2Fj8A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: functions: VOLATILE performs better than STABLE  (Laurenz Albe <laurenz.albe@cybertec.at>)
Список pgsql-performance
On 25 March 2018 at 18:00, Laurenz Albe <laurenz.albe@cybertec.at> wrote:
> Peter wrote:
>> Over all, VOLATILE performs better than STABLE.
>
> The reason is that the subquery with the VOLATILE function can be
> flattened; see the EXPLAIN (VERBOSE) output.
>
> There is not guarantee that less volatility means better performance.

Although, it would be nice.

TPC-H Q1 does appear to be crafted to allow database with smarter
expression evaluation to get a better score.

It would probably require some sort of recursive expression evaluation
where at each level we check if that expression has already been seen,
if it has, then replace it with some sort of placeholder, then
evaluate each placeholder in the required order.

Probably the first part could be done during planning.  It would mean
targetlists would need to carry a bit more weight.

It would be an interesting project to work on, but not planning to personally.

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


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

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: Should from_collapse be switched off? (queries 10 times faster)
Следующее
От: bk@e8s.de
Дата:
Сообщение: Re: Slow planning time for custom function