为什么两台相同的机器选择两种不同的执行计划? [英] Why would two identical machines choosing two different execution plans?

查看:131
本文介绍了为什么两台相同的机器选择两种不同的执行计划?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用我们的开发数据库,​​每个开发人员都会下载并将其恢复到开发PC。

With our development database each developer downloads and restores it to their development PC.

从(视图)ORDER BY(列)查询SELECT DISTINCT(列)形式)需要6分钟才能在我的电脑上运行,但会立即在另一台开发者的电脑上运行。

A query of the form SELECT DISTINCT (column) from (view) ORDER BY (column) takes 6 minutes to run on my PC but runs instantly on another developer's PC.

查看所选择的执行计划,我们可以看到我的电脑选择垃圾计划,但另一台机器选择了很多更好的一个。

Looking at the execution plan chosen we can see my PC chooses a rubbish plan but the other machine chooses a much better one.

我们一直在努力寻找有什么区别 - 我们使用相同版本的SQL Server,我们有相同的配置,我们有相同的硬件和相同的操作系统,我们有相同的数据库。我们怎样才能找出导致差异的原因?

We've been trying to find what the difference is - we are on the same version of SQL Server, we have the same configuration, we have the same hardware and same operating system, we have the same database. How can we figure out what is causing the difference?

推荐答案

你能不能通过以下文章..可以帮助你。

Can you please go through below Article ..it may helps you.

https://sqlperformance.com/2014/12/sql-plan/different-plans-identical-servers

https://sqlperformance.com/2014/12/sql-plan/different-plans-identical-servers

===================================== ==============================

请点击"标记为答案"如果它解决了你的问题和/或"投票有用"如果有帮助的话这对阅读此主题的其他社区成员有益。

===================================================================
Please click "Mark as Answer" if it solved your issue and/or "Vote as helpful" if it helped. This can be beneficial to other community members reading this thread.


这篇关于为什么两台相同的机器选择两种不同的执行计划?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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