Calculate the size of the index row

Use these formulas for clustered and nonclustered indexes on data-only-length tables.

Index rows containing variable-length columns require more overhead than index rows containing only fixed-length values.


Fixed-length keys only

If the index contains only fixed-length keys defined as NOT NULL, use:

    9

(Overhead)

+

Sum of fixed-length keys

Size of index row


Some variable-length keys

If the index contains any variable-length keys or columns that allow NULL values, use:

Formula

Example

    9

(Overhead)

       9

+

Sum of length of fixed-length keys

+

       4

+

Sum of length of variable-length keys

+

     20

+

Number of variable-length keys * 2

+

       2

Size of index row

     35