Joh*_*ney 68
以下是SQL92标准,因此大多数使用SQL的RDMBS应该支持:
CREATE INDEX [index name] ON [table name] ( [column name] )
Run Code Online (Sandbox Code Playgroud)
Sql Server 2005
使您能够指定覆盖索引.这是一个包含叶级别其他列的数据的索引,因此您不必返回到表中以获取未包含在索引键中的列.
create nonclustered index my_idx on my_table (my_col1 asc, my_col2 asc) include (my_col3);
Run Code Online (Sandbox Code Playgroud)
这是无价的,有一个查询my_col3
在选择列表,并my_col1
和my_col2
在where子句.