Re: function calls optimization

Поиск
Список
Период
Сортировка
Искать
От
Andres Freund
Тема
Re: function calls optimization
Дата
Msg-id
668AB6FB-A831-4B63-81D9-3A136232B41C@anarazel.de
Ответ на
Список
Дерево обсуждения
function calls optimization Andrzej Barszcz <abusinf@gmail.com>
Re: function calls optimization Andres Freund <andres@anarazel.de>
Re: function calls optimization Tom Lane <tgl@sss.pgh.pa.us>
Re: function calls optimization Andres Freund <andres@anarazel.de>
Re: function calls optimization Tom Lane <tgl@sss.pgh.pa.us>
Re: function calls optimization Andres Freund <andres@anarazel.de>
Re: function calls optimization Tom Lane <tgl@sss.pgh.pa.us>
Re: function calls optimization Jim Finnerty <jfinnert@amazon.com>
Re: function calls optimization Andres Freund <andres@anarazel.de>
Re: function calls optimization Andrzej Barszcz <abusinf@gmail.com>
Re: function calls optimization Andres Freund <andres@anarazel.de>
Re: function calls optimization Andrzej Barszcz <abusinf@gmail.com>
Re: function calls optimization Andy Fan <zhihui.fan1213@gmail.com>
Re: function calls optimization Andrzej Barszcz <abusinf@gmail.com>
Re: function calls optimization Andres Freund <andres@anarazel.de>
Re: function calls optimization Andreas Karlsson <andreas@proxel.se>
Hi, 

On October 31, 2019 7:45:26 AM PDT, Tom Lane  wrote:
>Andres Freund  writes:
>> On October 31, 2019 7:06:13 AM PDT, Andrzej Barszcz
> wrote:
>>> I almost finished patch optimizing non volatile function calls.
>>> 
>>> select f(t.n) from t where f(t.n) > 10 and f(t.n) < 100;  needs 3
>calls
>>> of
>>> f() for each tuple,
>>> after applying patch only 1.
>>> 
>>> Any pros and cons  ?
>
>> Depends on the actual way of implementing this proposal. Think we
>need more details than what you idea here.
>
>We've typically supposed that the cost of searching for duplicate
>subexpressions would outweigh the benefits of sometimes finding them.

Based on profiles I've seen I'm not sure that's the right choice. Both for when the calls are expensive (say postgis stuff), and for when a lot of rows are processed.

I think one part of doing this in a realistic manner is an efficient search for redundant expressions. The other, also non trivial, is how to even represent references to the results of expressions in other parts of the expression tree / other expressions.

Andres
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


В списке pgsql-hackers по дате отправления
От: Tom Lane
Дата:
От: Fabien COELHO
Дата:
FAQ