
Step 3. Total the Calculated Values
Total the values obtained from the previous two steps:
Clustered index size (bytes) = Leaf_Space_Used + Index_Space_used
This calculation does not consider the following:
-
Partitioning
The space overhead from partitioning is minimal, but complex to calculate. It is not important to include.
-
Allocation pages
There is at least one IAM page used to track the pages allocated to a heap, but the space overhead is minimal and there is no algorithm to deterministically calculate exactly how many IAM pages will be used.
-
Large object (LOB) values
The algorithm to determine exactly how much space will be used to store the LOB data types varchar(max), varbinary(max), nvarchar(max), text, ntext, xml, and image values is complex. It is sufficient to just add the average size of the LOB values that are expected, multiply by Num_Rows, and add that to the total clustered index size.
-
Compression
You cannot pre-calculate the size of a compressed index.