首页 > 数据库

Temporary Tables vs. Table Variables and Their Effect on SQL Server Performance

时间:2009-04-23 12:54:28  作者:武树伟  我要投稿
Linux初探欢迎您的投稿,投放方法请点击这里查看,我们会定期赠送精美小礼品给优秀的投稿作者。海纳百川 取则行远!LinuxGoo欢迎您的到来。
Temporary Tables vs. Table Variables and Their Effect on SQL Server Performance September 13th, 2007 Original http://www.sqlsolutions.com/articles/ar......

In some cases, SQL 2005 was much faster then SQL 2000 (marked with green). But in many cases, especially with huge amounts of data, procedures that used table variables took much longer (highlighted with red). In 4 cases, I even gave up waiting.

Conclusion:

1. There is no universal rule of when and where to use temporary tables or table variables. Try them both and experiment.

2. In your tests, verify both sides of the spectrum - small amount/number of records and the huge data sets.

3. Be careful with migrating to SQL 2005 when you use complicated logic in your stored procedures. The same code can run 10-100 times slower on SQL server 2005!

如果您需转载 Temporary Tables vs. Table Variables and Their Effect on SQL Server Performance,请注明来自LinuxGoo.com,其版权归原作者所有。请广大网友留言时遵纪守法,使用文明用语。如果您在应用中有什么问题,请在下面留言,我们会尽快解答。
来顶一下
近回首页
返回首页
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表
相关文章
栏目热门