DEV Community

[Comment from a deleted post]
Collapse
 
seann profile image
Seann Alexander

People reading this post, please be wary.

CTEs will not always materialize (store in memory) the intermediate results.

For example, if you join the results of a CTE, you may Infact execute that CTE for each row in the joined table.

Also, for SQL Server, attempts to force materialization may not always work.

stackoverflow.com/questions/130900...