Re: function calls optimization

Поиск
Список
Период
Сортировка
От Jim Finnerty
Тема Re: function calls optimization
Дата
Msg-id 1572537382433-0.post@n3.nabble.com
обсуждение исходный текст
Ответ на Re: function calls optimization  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I recently implemented something closely related to this.  Combining and
migrating expensive STABLE user-defined functions to the FROM clause, where
the function is evaluated as a lateral join (or "cross apply").  I'm
defining expensive as 50x times more expensive than the default function
cost.

For functions that return multiple outputs and where the query uses (...).*
notation, this will, for example, consolidate all of the calls in the *
expansion into a single call.  It also looks in the WHERE clause and HAVING
clause, and combines those references, too.  Currently it requires the
function to be in a top-level AND condition, if it appears in a predicate.

I think I can get permission for contributing it back.  If there's an
interest in it, let me know.



-----
Jim Finnerty, AWS, Amazon Aurora PostgreSQL
--
Sent from: https://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: function calls optimization
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Allow cluster_name in log_line_prefix