





















这是一个创建于 1174 天前的主题,其中的信息可能已经有所发展或是发生改变。
请教懂 sqlserver 数据库的大神,帮忙看看我一个 sql 语句查询缓慢的问题:
语句 1:select * from table1 where optime>='2023-03-01' and optime<='2023-03-28',表里有 5000 万数据,optime 字段做有索引,查询在 1 秒之内就出结果了。
语句 2: select count(1) from (select * from table1 where optime>='2023-03-01' and optime<='2023-03-28') a ,查询非常缓慢,基本都是超时。感觉 optime 索引没用一样。
请帮忙看看怎么改进。谢谢
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。