3 ms·
You must be doing something wrong then. MSSQL resolves the entire statement (CTEs plus final query) into a single query that it optimizes as a whole. Can you s
by endianswap 13y ago
You must be doing something wrong then. MSSQL resolves the entire statement (CTEs plus final query) into a single query that it optimizes as a whole.
Can you share an example of two queries that are equivalent where one is written using CTEs and it doesn't construct the same plan?