sql 索引(index)
2010-11-07 23:50
465 查看
--------------------------------
---------索引操作---------------
--------------------------------
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
---------索引操作---------------
--------------------------------
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
相关文章推荐
- DBCC大全集之(适用版本MS SQLServer 2008 R2)----DBCC INDEXDEFRAG指定表或视图的索引碎片整理
- MySQL之 SQL force Index 强制索引
- SQL_INDEX 索引
- Oracle index】SQL语句无法走索引的一些情况分析及语句改写思路
- SQL大圣之路笔记——SQL 创建索引 index
- sphinx在建立索引时出现ERROR: index 'xxx': sql_connect: Access denied for user 'xxx'@'localhost' 不能连接数据库的错误解决
- Scripts:创建索引组织表例子example_create_index_organized_table.sql
- Oracle index】SQL语句利用函数索引注意点
- Oracle Index 索引介绍(SQL)
- 【SQL】index索引
- SQL2012 重新组织和新生成索引sp_RefreshIndex
- 在pl/sql 里实现index 索引 效果
- 《高性能SQL调优精要与案例解析》一书谈主流关系库SQL调优(SQL TUNING或SQL优化)核心机制之——索引(index)
- 数据库索引 index介绍 sql索引存储结构
- ylb:SQL 索引(Index)
- 黑马程序员_SQL 索引index、通配符和数据类型
- SQL Server查询数据库所有存储过程、触发器、索引信息SQL分享
- MySQL索引,MySQL性能分析及explain的使用,分析SQL查询性能
- java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
- stmt.setDate(columnIndex, java.sql.Date);