SQL查询效率:100w数据查询只需要1秒钟
关于SQL查询效率,100w数据,查询只要1秒,与您分享:
机器情况:
p4: 2.4
内存: 1 G
os: windows 2003
数据库:
SQL Server 2000
目的: 查询性能测试,比较两种查询的性能
SQL查询效率 step by step
-- setp 1.
-- 建表
create table t_userinfo
(
userid int identity(1,1) primary key nonclustered,
nick varchar(50) not null default '',
classid int not null default 0,
writetime datetime not null default getdate()
)
go
-- 建索引
create clustered index ix_userinfo_classid on t_userinfo(classid)
go
-- step 2.
declare @i int
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余3页未读,立即下载