Re: [HACKERS] CTE inlining

Поиск
Список
Период
Сортировка
От Andreas Karlsson
Тема Re: [HACKERS] CTE inlining
Дата
Msg-id 19fe51b0-1d0b-a72c-99ee-aacb5b4930f8@proxel.se
обсуждение исходный текст
Ответ на Re: [HACKERS] CTE inlining  (Andrew Dunstan <andrew.dunstan@2ndquadrant.com>)
Ответы Re: [HACKERS] CTE inlining  (Craig Ringer <craig.ringer@2ndquadrant.com>)
Список pgsql-hackers
On 05/04/2017 06:22 PM, Andrew Dunstan wrote:
> I wrote this query:
>
>     select (json_populate_record(null::mytype, myjson)).*
>     from mytable;
>
>
> It turned out that this was an order of magnitude faster:
>
>     with r as
>     (
>        select json_populate_record(null::mytype, myjson) as x
>        from mytable
>     )
>     select (x).*
>     from r;

I do not know the planner that well, but I imagined that when we remove 
the optimization fence that one would be evaluated similar to if it had 
been a lateral join, i.e. there would be no extra function calls in this 
case after removing the fence.

Andreas



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

Предыдущее
От: Alexander Korotkov
Дата:
Сообщение: Re: [HACKERS] WIP Patch: Precalculate stable functions,infrastructure v1
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] what's up with IDENTIFIER_LOOKUP_EXPR?