CTE(通用表表达式)与临时表或表变量,哪个更快? [英] CTE (Common Table Expression) vs Temp tables or Table variables, which is faster?

查看:19
本文介绍了CTE(通用表表达式)与临时表或表变量,哪个更快?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CTE (Common Table Expression) vs Temp tables or Table variables,哪个更快?

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

推荐答案

在一个特殊情况下,我们将迁移到 CTE 的速度提高了 50%,因此值得一试,但任何与性能相关的增强都需要进行基准测试,因此您可以将一个与另一个进行比较.

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:在获得现在使用的查询之前,我们编写了不止一个带有 CTE 的查询.

PS: we wrote more than one query with a CTE in it before we got the one we now use.

这篇关于CTE(通用表表达式)与临时表或表变量,哪个更快?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆