22,199
社区成员
发帖
与我相关
我的任务
分享
select * from Tab with (index (indexname))
where col1(你加索引的列)
alter database tb
set auto_create_statistics off
set update_create_statistics on
go
create table tb
(
id identity(1,1) primary key,
[Name] varchar(20),
sex varchar(1)
)
insert into tb select top 2000 '',N'女' from syscolumns C1,syscolumns C2
create index index_sex on tb(sex)
--(1)
set statictics io on
select * from tb where sex=N'女'
set statictics io off
--(2)与(1)进行比较
create statictics sta_tb on tb(sex)--建立统计信息
set statictics io on
select * from tb where sex=N'女'
set statictics io off
http://topic.csdn.net/u/20090313/20/2287914b-309c-4c4e-806c-23ca6d3c5c54.html