是的,目录视图sys.partitions包含此信息.该字段index_id将告诉您表是堆(index_id = 0)还是b-tree(index_id> 0).
select
o.name,
o.object_id,
case
when p.index_id = 0 then 'Heap'
when p.index_id = 1 then 'Clustered Index/b-tree'
when p.index_id > 1 then 'Non-clustered Index/b-tree'
end as 'Type'
from sys.objects o
inner join sys.partitions p on p.object_id = o.object_id
where name = 'YourTableName'
Run Code Online (Sandbox Code Playgroud)
从文档 - 表和索引组织:
此分区所属的对象中的索引的ID.
Run Code Online (Sandbox Code Playgroud)0 = heap 1 = clustered index 2 or greater = nonclustered堆是没有聚簇索引的表.非聚簇索引具有类似于聚簇索引中的B树索引结构.
| 归档时间: |
|
| 查看次数: |
2834 次 |
| 最近记录: |