DB2 Version 9.7 for Linux, UNIX, and Windows

Estimating space requirements for tables and indexes

Use the Estimate Size window to estimate the amount of storage space required for a new or existing table or index. The estimated storage space is determined from the definition of a particular table and its dependent indexes. Minimum and maximum storage values are estimated for these objects.

About this task

Reasons to estimate space requirements for tables and indexes include:
  • To create a new table and determine the size of the table space required.
  • To create a new table based on the size estimate of an existing table.
  • To rearrange a table space. For example, you want to move a table from table space A to table space B, and you want to know how much space the table uses in table space A.
  • To identify the amount of space occupied by different objects in the table space because the system is running out of storage space.
Note: For DB2® Enterprise Server Edition databases, size estimates are based on the logical size of the data in the table instead of by database partition.
To open the Estimate Size window, from the Control Center, expand the object tree until you find the Tables folder or Indexes folder. Click the Tables folder or Indexes folder. Any existing tables or indexes are displayed in the pane on the right side of the window (contents pane).
  • For an existing table or index, right-click the table or index you want in the contents pane, and click Estimate Size in the pop-up menu.
  • When you are creating a table or index, right-click the table or index folder and click Create Table or Create Index in the pop-up menu. The Create Table wizard or Create Index window opens. Complete the information required to create a table or index. Select Estimate Size from the Create Table wizard or Create Index window.

Since every row added to the table affects the storage used by the indexes as well as tables, the table and all its related indexes are displayed in the Estimate Size window.

If recent statistics are not available for the table or index, click Run statistics before updating the New total number of rows and New average row length fields and running a size estimate. The calculation of the size estimate can then be based on more accurate information. In the Run Statistics window that opens, either accept the default or select a different value for New total number of rows.