服务器更改后,查询现在非常慢

时间:2018-06-13 17:21:38

标签: sql-server sql-server-2016

更改服务器后,我们现在只需一个查询就会遇到极慢的执行时间。当我们在运行时分析会话时,我们会看到数百个(有时超过1000个)打开的会话都具有相同的会话ID,并且它们会自行阻止。这是一个摘录:

+----------------------+------------+-----------------+------------------+-----------+--------------------+-----------------------+---------------------+--------------------------+--------------------------------------------------------------------+
| waiting_task_address | session_id | exec_context_id | wait_duration_ms | wait_type |  resource_address  | blocking_task_address | blocking_session_id | blocking_exec_context_id |                        resource_description                        |
+----------------------+------------+-----------------+------------------+-----------+--------------------+-----------------------+---------------------+--------------------------+--------------------------------------------------------------------+
| 0x00000005A3B83468   |        161 |              19 |           121058 | CXPACKET  | 0x0000000EB9B9C830 | 0x00000010BF029C28    |                 161 |                        3 | exchangeEvent id=Pipe8a2d88200 WaitType=e_waitPipeNewRow nodeId=12 |
| 0x00000010BE003C28   |        161 |              10 |           121079 | CXPACKET  | 0x00000008A1A0E9C0 | 0x00000005734964E8    |                 161 |                       93 | exchangeEvent id=Pipe79fcc6200 WaitType=e_waitPipeNewRow nodeId=8  |
| 0x000000050BFA1088   |        161 |              42 |           121092 | CXPACKET  | 0x000000058C7C12D0 | 0x00000010B484A8C8    |                 161 |                       27 | exchangeEvent id=Pipe5647e2110 WaitType=e_waitPipeNewRow nodeId=15 |
| 0x0000000DFB199088   |        161 |              20 |           121094 | CXPACKET  | 0x0000000E77A4DCC0 | 0x00000005A3B82CA8    |                 161 |                       44 | exchangeEvent id=Pipe915578ed0 WaitType=e_waitPipeGetRow nodeId=15 |
| 0x0000000E501A64E8   |        161 |              66 |           121094 | CXPACKET  | 0x000000088DB9DCB0 | 0x0000000E44591C28    |                 161 |                       81 | exchangeEvent id=Pipe79fcc8d00 WaitType=e_waitPipeGetRow nodeId=5  |
| 0x0000000E501A64E8   |        161 |              66 |           121094 | CXPACKET  | 0x000000088DB9DCB0 | 0x00000003714868C8    |                 161 |                       82 | exchangeEvent id=Pipe79fcc8d00 WaitType=e_waitPipeGetRow nodeId=5  |
| 0x0000000E501A64E8   |        161 |              66 |           121094 | CXPACKET  | 0x000000088DB9DCB0 | 0x0000000DC854B848    |                 161 |                       83 | exchangeEvent id=Pipe79fcc8d00 WaitType=e_waitPipeGetRow nodeId=5  |
| 0x0000000E501A64E8   |        161 |              66 |           121094 | CXPACKET  | 0x000000088DB9DCB0 | 0x00000010B3A25848    |                 161 |                       84 | exchangeEvent id=Pipe79fcc8d00 WaitType=e_waitPipeGetRow nodeId=5  |
| 0x0000000E501A64E8   |        161 |              66 |           121094 | CXPACKET  | 0x000000088DB9DCB0 | 0x0000000F39DFA4E8    |                 161 |                       85 | exchangeEvent id=Pipe79fcc8d00 WaitType=e_waitPipeGetRow nodeId=5  |
+----------------------+------------+-----------------+------------------+-----------+--------------------+-----------------------+---------------------+--------------------------+--------------------------------------------------------------------+

我不确定是什么原因引起的。移动服务器之前,问题不存在。我们有一段很短的时间,在此期间查询在当前服务器上快速执行,现在再次出现执行时间慢的问题。

1 个答案:

答案 0 :(得分:0)

您是否比较了执行计划?如果您已将SQL升级到较新版本,您是否更新了统计信息?如果这些是不同的服务器与相同的数据库是相同的数据?索引是否相同?我曾经运行复制拓扑,并会删除订阅者上未使用的索引。

自我封锁并非真正阻挡。我认为他们在SQL 2005中引入了它并且它只是缓慢。