Hitachi

Hitachi Advanced Database Setup and Operation Guide


6.21.3 Estimating the size of the temporary work file for executing the adbmergechunk command

This section explains how to estimate the size of the temporary work file that is created when the adbmergechunk command is executed to merge multiple chunks.

When the adbmergechunk command is executed on a table for which an index is defined, a temporary work file is created under the following directory:

Use the following formula to determine the size of the temporary work file.

Formula (kilobytes)

[Figure]

Explanation of variables

idx_num

Number of B-tree indexes defined

RECFILE(i)

Index record file

Use the following formula to determine this value.

Formula (bytes)

[Figure]

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 merge-source chunks of the table targeted by the adbmergechunk 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)

[Figure]

TCTRL(i)

Control information for the i-th text index

  • For a text index

    Use the formula below to determine its value.

    Formula

    [Figure]

  • For an index other than a text index

    Substitute 0.

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)

[Figure]

IDXWORK(i)

Work file for creating B-tree indexes

Use the following formula to determine this value.

Formula (bytes)

[Figure]

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.

tix_num

Number of text indexes

TIXWORK(i)

Work file for creating text indexes

Use the following formula to determine its value.

Formula (bytes)

[Figure]

row_num

Number of rows that are stored in the merge-source chunks of the table targeted by the adbmergechunk command

string_num(i)

Average number of characters stored in the columns in a text index

define_num(i)

Defined length of columns in a text index

TIXCORWORK(i)

Work file for creating text indexes (for correction search)

You must determine this variable if you add the notation-correction-search text-index specification when defining a text index.

Use the following formula to determine this value.

Formula (bytes)

[Figure]

row_num

Number of rows that are stored in the merge-source chunks of the table targeted by the adbmergechunk command

string_num(i)

Average number of characters stored in the columns in a text index