CTE optimization fence

Поиск
Список
Период
Сортировка
От Guy Burgess
Тема CTE optimization fence
Дата
Msg-id ce9c1fb9-c309-f666-3221-5d5f9e66051e@burgess.co.nz
обсуждение исходный текст
Ответы Re: CTE optimization fence
Список pgsql-general
Hello,
I am running into performance issues with large CTE "WITH" queries (just 
for selecting, not updating).  I was surprised to find that the queries 
run much faster if I convert the CTEs to subqueries. From googling, I 
see that this is due to CTE acting as an optimization fence in PG. 
Unfortunately due to the application I'm dealing with, converting all 
CTE queries to subquery model is not feasible. Plus, the readability of 
CTE is a big bonus.

I see there was some discussion last year about removing the CTE 
optimization fence (e.g. 
http://www.postgresql-archive.org/CTE-inlining-td5958992.html) but can't 
find anything more recent. Does anyone know if this is still under 
consideration? For what it's worth, I would love some way to make CTEs 
inlined/optimized.

Thank you very much to the developers for a truly amazing database system.

Thanks
Guy



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

Предыдущее
От: Melvin Davidson
Дата:
Сообщение: Re: We find few queries running three times simultaneously with sameparameters on postgres db
Следующее
От: Tom Lane
Дата:
Сообщение: Re: CTE optimization fence