Compute the size of clustered index rows

Index rows containing variable-length columns require more overhead than index rows containing only fixed-length values. Use the first formula if all the keys are fixed length. Use the second formula if the keys include variable-length columns or allow NULL values.


Fixed-length columns only

The clustered index in the example has only fixed-length keys.

Formula

Example

     5

(Overhead)

     5

+

Sum of bytes in the fixed-length index keys

+

     4

= Clustered row size

     9


Some variable-length columns

   5

(Overhead)

+

Sum of bytes in the fixed-length index keys

+

Sum of bytes in variable-length index keys

= Subtotal

+

(Subtotal / 256) + 1 (Overhead)

+

Number of variable-length columns + 1

+

    2

(Overhead)

= Clustered index row size

The results of the division (Subtotal / 256) are rounded down.