--------------------------------
---------索引操作---------------
--------------------------------
use stuDB
go
--创建索引
if exists (select * from sysindexes where [name] ='ix_stuMarks_writtenExam' )
drop index stuMarks.ix_stuMarks_writtenExam
--create unique(唯一索引)、clustered(聚集索引)、nonclustered(非聚集索引)
create nonclustered index ix_stuMarks_writtenExam
on stuMarks (writtenExam)
with fillfactor=30--索引页填满的空间所占百分比
go
select * from stuMarks
with(index=ix_stuMarks_writtenExam)
where writtenExam>60
go
sql 索引(index)
最新推荐文章于 2025-01-03 17:30:47 发布