CTE (Common Table Expression) vs Temp tables or Table variables, which is faster?
问题 CTE (Common Table Expression) vs Temp tables or Table variables , which is faster? 回答1: We got a 50% increase in speed moving to CTE in one particular case so it's worth giving it a go but any performance related enhancements need to be bench marked so you can compare one against another. PS: we wrote more than one query with a CTE in it before we got the one we now use. 回答2: As I already said in my comment: IT DEPENDS! It really does depend on your query, your data (how much is there? What