3 ms·
> https://dba.stackexchange.com/a/13117 https://dba.stackexchange.com/a/13117 Also, a CTE should never be used for performance. You will almost never speed thin
by jteppinette 7y ago
> https://dba.stackexchange.com/a/13117 https://dba.stackexchange.com/a/13117
Also, a CTE should never be used for performance. You will almost never speed things up by using a CTE, because, again, it's just a disposable view.
- wolf550e 7y agoInformation about SQL in general should not be confused with information about specific RDBMS. That SE answer is about MS SQL Server. What I wrote was specific to PostgreSQL which does a specific weird thing using CTEs where they are materialized. In SQL Server, CTEs are not materialized and are just used to organize the query, to make it more readable. If I wrote about PostgreSQL heap organized tables, would you object and say I'm wrong because MS SQL Server tables are index-organized, clustered on the primary key?
- hobs 7y agoGood answer, but fwiw SQL Server has heaps too :p