Calculating the sizes of data-only-locked tables

The formulas and examples that follow show how to calculate the sizes of tables and indexes. This example uses the same column sizes and index as the previous example. All of the formulas use the maximum size of the variable-length fields. See “Tables and indexes used in the formulas” for the specifications.

The formulas for data-only-locked tables are divided into two sets of steps:

optdiag output includes the average length of data rows and index rows. You can use these values for the data and index row lengths, if you want to use average lengths instead.

The steps are:

  1. “Calculate the data row size”

  2. “Compute the number of data pages”

  3. “Calculate allocation overhead and total pages”

  4. “Calculate the size of the index row”

  5. “Calculate the number of leaf pages in the index”

  6. “Calculate the number of non-leaf pages in the index”

  7. “Calculate the total number of non-leaf index pages”

  8. “Calculate allocation overhead and total pages”