--Check the index fragmentation situation
DBCC SHOWCONFIG (tablename)
Specific examples:
--Before the defragmentation
ALTER INDEX all on citation REBUILD
-After the defragmentation
--Extents Switches:extents Scanned-1
-AVG. Pages per Extent: Default 1 Zone 8 page, less than 8, with external fragmentation
-AVG. Bytes free per page: The higher the value of 8000 Bytes, the greater the internal fragmentation, or the filling factor is too low;
External: There are pages in the area that are not being used
Internal: There is no space left in the page to be used
DBCC IND (dbname,tablename,#)
--#: -1~2
--INDEXID: Index type id,0 represents a heap, 1 is a clustered index, and 2-250 represents a nonclustered index. You can find it on the Sys.indexs
--Page type:1 = Data page, 2 = index page, 3 = lob_mixed_page, 4 = lob_tree_page, ten = IAM Page
DBCC Traceob (3604)
DBCC page (dbname,pagefid,pagepid,#)
--#:0~3
sp_spaceused TableName
--Reserved:data + index_size + unused
--Data:data Page * 8k
--Index_size:index Page * 8k + IAM page * 8k
DBCC for SQL Server