【发布时间】:2014-11-07 19:19:18
【问题描述】:
最近被要求帮助查询优化
表格如下所示:
create table dbo.Table
(
id int identity primary key clustered ,
column_1 varchar(64) not null ,
Date datetime not null ,
Column_2 varchar (32) not null ,
Column_3 int not null
)
然后选择看起来像
select * from Table where column_1 = @value1 and Date > @value2
我建议在 select 中显示列名称而不是 *,因为它可以帮助避免加载不需要的数据,还建议在 column_1 上显示 create nonclustered index。但是,执行计划仍然显示查询使用的内存量。
我还应该检查或添加什么到查询中?
【问题讨论】:
标签: sql sql-server-2008-r2 sql-optimization