sys.indexes (Transact-SQL)
每个表格对象(例如,表、视图或表值函数)的索引或堆都包含一行。
列名 | 数据类型 | 说明 |
---|---|---|
object_id | int | 该索引所属对象的 ID。 |
name | sysname | 索引的名称。 name is unique only within the object." data-guid="e338e16d7d234b6006a785ae17f509a4">name 只在该对象中是唯一的。 NULL = 堆 |
index_id | int | 索引的 ID。 index_id is unique only within the object." data-guid="5ec235a83f711f0d893841335b0dc042">index_id 只在该对象中是唯一的。 0 = 堆 1 = 聚集索引 > 1 = 非聚集索引 |
类型 | tinyint | 索引的类型: 0 = 堆 1 = 聚集 2 = 非聚集 3 = XML 4 = 空间 5 = 聚集列存储索引(保留以供将来使用。) 6 = 非聚集列存储索引 |
type_desc | nvarchar(60) | 索引类型的说明: HEAP CLUSTERED NONCLUSTERED XML SPATIAL CLUSTERED COLUMNSTORE(保留以供将来使用。) NONCLUSTERED COLUMNSTORE |
is_unique | bit | 1 = 索引是唯一的。 0 = 索引不是唯一的。 |
data_space_id | int | 该索引的数据空间的 ID。 数据空间是文件组或分区方案。 object_id is a table-valued function." data-guid="ae624b71e2370fa10f103b94f9b28c18">0 = object_id 是表值函数。 |
ignore_dup_key | bit | 1 = IGNORE_DUP_KEY 是 ON。 0 = IGNORE_DUP_KEY 是 OFF。 |
is_primary_key | bit | 1 = 索引是 PRIMARY KEY 约束的一部分。 |
is_unique_constraint | bit | 1 = 索引是 UNIQUE 约束的一部分。 |
fill_factor | tinyint | > 0 = 创建或重新生成索引时使用的 FILLFACTOR 百分比。 0 = 默认值 |
is_padded | bit | 1 = PADINDEX 是 ON。 0 = PADINDEX 是 OFF。 |
is_disabled | bit | 1 = 禁用索引。 0 = 不禁用索引。 |
is_hypothetical | bit | 1 = 索引是假设的,不能直接用作数据访问路径。 假设的索引包含列级统计信息。 0 = 索引不是假设的。 |
allow_row_locks | bit | 1 = 索引允许行锁。 0 = 索引不允许行锁。 |
allow_page_locks | bit | 1 = 索引允许页锁。 0 = 索引不允许页锁。 |
has_filter | bit | 1 = 索引具有一个筛选器,且仅包含符合筛选器定义的行。 0 = 索引不具有筛选器。 |
filter_definition | nvarchar(max) | 包含在筛选索引中的行子集的表达式。 对于堆或非筛选索引,其值为 NULL。 |