Understanding Temporary tables, CTEs, and table variables performance

By Wednesday, November 6, 2013 Permalink 0

Recently a colleague had a rather interesting question, should we use a temporary table instead of a Common Table Expression (CTE) for this problem? Then he continues and says "CTEs are usually slower than temp tables". For this specific problem, aggregating and filtering 10 records, CTEs seemed to be the right solution; however, this is ...