Re: function calls optimization

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: function calls optimization
Дата
Msg-id EC3B2F1D-A065-445F-A028-50E2677844B8@anarazel.de
обсуждение исходный текст
Ответ на Re: function calls optimization  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Hi

On October 31, 2019 7:53:20 AM PDT, Andres Freund <andres@anarazel.de> wrote:
>On October 31, 2019 7:45:26 AM PDT, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>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.

One way to improve the situation - which is applicable in a lot of situations, e.g. setrefs.c etc - would be to compute
hashesfor (sub-) expression trees. Which makes it a lot easier to bail out early when trees are not the same, and also
easierto build an efficient way to find redundant expressions. There's some complexity in invalidating such hashes once
computed,and when to first compute them, obviously. 

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



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

Предыдущее
От: Ibrar Ahmed
Дата:
Сообщение: Re: [BUG] Partition creation fails after dropping a column and addinga partial index
Следующее
От: Andreas Karlsson
Дата:
Сообщение: Re: function calls optimization