CTE (Common Table Expression) vs Temp tables or Table variables, which is faster?

后端 未结 3 2011
庸人自扰
庸人自扰 2021-02-13 18:55

CTE (Common Table Expression) vs Temp tables or Table variables, which is faster?

3条回答
  •  南方客
    南方客 (楼主)
    2021-02-13 19:44

    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.

提交回复
热议问题