0

当我在 SQL Server 2016 中运行带有 TABLERESULTS、ALL_INDEXES、NO_INFOMSGS 的 DBCC SHOWCONTIG ('schema_name.table_name') 时,它会针对某些表返回 2 行

下面的例子:

ObjectName  ObjectId    IndexName   IndexId Level   Pages   Rows    MinimumRecordSize   MaximumRecordSize   AverageRecordSize   ForwardedRecords    Extents ExtentSwitches  AverageFreeBytes    AveragePageDensity  ScanDensity BestCount   ActualCount LogicalFragmentation    ExtentFragmentation

table1_ 1891549497  col_st_idx  1   0   0   0   0   0   0   0   0   0   0   0   100 0   0   0   0
table_  1891549497  col_st_idx  1   0   1   10  553 641 593.6   0   1   0   2140    73.5606622189276    100 1   1   0   0 

我无法理解这种行为的原因,因为理想情况下它应该只返回 1 行,有人可以提供什么吗?

4

1 回答 1

0
drop table if exists testtblZ
go

--clustered
create table testtblZ(col char(900) default('aaaa') not null);
create clustered index idxtesttblZ on testtblZ(col);
go
insert into testtblZ(col)
values(newid());
go 10
DBCC SHOWCONTIG ('testtblZ') WITH TABLERESULTS, ALL_INDEXES, NO_INFOMSGS;
go


--columnstore
create clustered columnstore index idxtesttblz on testtblz with (drop_existing = on);
go
insert into testtblZ(col)
values(newid());
go 10
DBCC SHOWCONTIG ('testtblZ') WITH TABLERESULTS, ALL_INDEXES, NO_INFOMSGS;
go
于 2020-11-27T14:36:38.960 回答