【发布时间】:2012-07-16 21:07:56
【问题描述】:
我正在使用 SQL Server 2008 Management Studio 连接到 SQL Server 2000。
use [MyPrettyDb]
select top 19 * from information_schema.tables
它工作得很好,又甜又快。但是这个:
select top 20 * from information_schema.tables
超时停止。
超时的原因是什么?
附: select count(*) from information_schema.tables 快速返回;数据库中有334张表。
【问题讨论】:
-
你对比过两个案例的执行计划了吗?
-
为什么要从目录视图中获得 19 或 20 个 随机 行?或许您可以考虑添加一个
ORDER BY来为您的查询赋予一些意义。 -
不可能。查询计划超时
-
好的。 select top 19 * from information_schema.tables order by table_name - 效果很好。但是从 information_schema.tables 中按 table_name 顺序选择前 20 个 * - 超时
-
另外我可以补充一点:硬件没问题。大量磁盘空间和 54% 的内存使用率。
标签: tsql timeout sql-server-2000 information-schema