我在 SQL 中有一个超过 2000 万行的表。数据从该表中的多个位置存储。我必须对日期进行查询。我不能使用任何过滤器,因为我必须明智地展示数据位置。从单个表运行数据需要 30 多分钟。我该如何管理它?我也尝试过索引,但没有任何区别
-- declare @DateTo as DateTime ='2018-08-01';
select distinct
[Location Code]
,[Bin Code]
,[Item No_]
,[Quantity]
,[Qty_ (Base)]
,[Zone Code]
,[Bin Type Code]
,[Lot No_]
,[Registering Date]
from
[Warehouse Entry]
where
[Registering Date] <= @DateTo;