6.21.5 Estimating the size of the temporary work file for executing the adbreorgsystemdata command
This subsection explains how to estimate the size of the temporary work file that is created when the adbreorgsystemdata command is executed to reorganize a system table (base table).
When the adbreorgsystemdata command is executed on a table for which an index is defined, a temporary work file is created under the following directory:
-
If the -w option is specified
A temporary work file is created under the specified directory.
-
If the -w option is not specified
A temporary work file is created under the DB directory ($DBDIR/ADBWORK).
Use the following formula to determine the size of the temporary work file.
Formula (kilobytes)
Explanation of variables
- idx_num
-
Number of B-tree indexes defined for the system table (base table) to be reorganized
For details about the B-tree indexes defined for the system table (base table) to be reorganized, see C.8 B-tree indexes of system tables (base tables).
- RECFILE(i)
-
Index record file
Use the following formula to determine this value.
Formula (bytes)
- KEYSZ(i)
-
Key length of the i-th B-tree index (bytes)
Determine the key length of the B-tree index based on 5.8.4 Determining the key length (KEYSZ) of a B-tree index. For variable-length data, use the actual data length.
- CTRL(i)
-
Control information for the i-th B-tree index
-
If all indexed columns have fixed-length keys: 10 bytes
-
If any of the indexed columns have variable-length keys: 12 bytes
-
- row_num
-
Number of rows that are stored in the table targeted by the adbreorgsystemdata command
- SORTFILE(i)
-
Sort result file
Use the following formula to determine this value. For the variables KEYSZ(i), CTRL(i), and row_num, determine their values by referring to the formula for the preceding index record file (variable RECFILE(i)).
Formula (bytes)
- SORTWORK(i)
-
Sort work file
Use the following formula to determine this value. For the variables RECFILE(i) and row_num, determine their values by referring to the formula for the preceding index record file (variable RECFILE(i)).
Formula (bytes)
- IDXWORK(i)
-
Work file for creating B-tree indexes
Use the following formula to determine this value.
Formula (bytes)
- KEYSZDB(i)
-
Length of the i-th database storage key (bytes)
For details, see the description of the variable KEYSZDB in (1) Determining the number of storage pages used in the lower page segment (variable IP_LOWER(i)) under 5.8.3 Determining the number of storage pages for each B-tree index segment. For variable-length data, always use the definition length as the key length.
- PIDX_LEAF
-
Number of pages in the first level of the B-tree index (leaf pages)
Determine this value by using Formula 1 (for determining PIDX_LEAF) in (1) Determining the number of storage pages used in the lower page segment (variable IP_LOWER(i)) under 5.8.3 Determining the number of storage pages for each B-tree index segment.
- PIDX(2)
-
Number of pages in the second level of the B-tree index
Determine this value by using Formula 1 (for determining PIDX(k)) in (2) Determining the number of storage pages used in the upper page segment (variable IP_UPPER(i)) under 5.8.3 Determining the number of storage pages for each B-tree index segment.