Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Administration - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 6525

Index Space calculation confusion

$
0
0
For some of the table we are changing Clustered indexes to non clustered index (we can avoid here "why to CLUS to Non CLus"? discussion )Strange thing is index size got increased (for every table) when we convert "clus" index into NON clu index ?See Code[code="sql"]SET NOCOUNT ON --DROP TABLE bk2goCREATE TABLE BK2 (stub ut_stub )GOINSERT INTO bk2 SELECT NEWID()go 10000EXEC sys.sp_spaceused 'BK2',@updateusage = N'TRUE';GOCREATE clustered INDEX idx1 ON bk2(stub)GOEXEC sys.sp_spaceused 'BK2',@updateusage = N'TRUE';GOdrop index idx1 on bk2GOEXEC sys.sp_spaceused 'BK2',@updateusage = N'TRUE';GOCREATE INDEX idx ON bk2(stub)GOEXEC sys.sp_spaceused 'BK2',@updateusage = N'TRUE';GO[/code][quote]name rows reserved data index_size unused heap BK2 10000 344 KB 264 KB 24 KB 56 KB CLU BK2 10000 328 KB 248 KB [b]16 KB[/b] 64 KB heap BK2 10000 264 KB 248 KB 8 KB 8 KB NC BK2 10000 656 KB 248 KB [b]328 KB[/b] 80 KB[/quote]index size got increased from 16 to 328 KB

Viewing all articles
Browse latest Browse all 6525

Trending Articles