Search Postgresql Archives

CTE optimization fence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux