我想知道为什么非分区表在 sys.partitions 中会有多个孤立记录。由于它是非分区表,因此 sys.partitions 和 sys.dm_db_partition_stats 中应该只有一条记录。
有谁知道这是否是一个问题,如果是,我该如何解决?
谢谢!
编辑: 查询是:
select * from sys.dm_db_partition_stats a right join sys.partitions b on a.partition_id = b.partition_id WHERE b.object_id = OBJECT_ID('tableA')
结果是:
partition_id partition_id index_id partition_number hobt_id rows
72057602390818816 72057602390818816 5 1 72057602390818816 1844605
72057602776891392 NULL 1 1 72057602776891392 1842474
72057602776956928 NULL 1 1 72057602776956928 1842474
72057602777939968 NULL 1 1 72057602777939968 1842498
72057602778071040 NULL 1 1 72057602778071040 1842658
72057602782593024 NULL 6 1 72057602782593024 1842944
72057602783707136 72057602783707136 1 1 72057602783707136 1844605
72057602783772672 72057602783772672 6 1 72057602783772672 1844605
哎呀,有没有办法让它更具可读性?
最佳答案
来自 MSDN 文档 HERE :
All tables and indexes in SQL Server contain at least one partition, whether or not they are explicitly partitioned.
多行可能对应于您的索引,检查object_id和index_id并与sys.indexes进行比较。
关于sql-server - 非分区表的 sys.partition 中的多个记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28592262/