Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.


Information 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?


Good answer, but fwiw SQL Server has heaps too :p




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: