Hitachi

Hitachi Advanced Database Setup and Operation Guide


6.21.1 Estimating the size of the temporary work file for executing the adbimport command

This section explains how to estimate the size of the temporary work file that is created when the adbimport command is executed to import data.

The following temporary work files are created:

■ Temporary work files for creating indexes

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

Use the following formula to determine the size of the temporary work file for creating indexes:

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 to be stored by the adbimport 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 shown below to determine its value.

    Formula

    [Figure]

  • For an index other than a text index

    Assign 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 to be stored by the adbimport 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 to be stored by the adbimport command

string_num(i)

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

■ Temporary work files for data compression

A temporary work file for data compression is created only when storing data in a column store table.

Use the following formula to determine the size of the temporary work file for data compression:

Formula (kilobytes)

[Figure]

Explanation of variables

col_num

Total number of columns in the table to be processed (columns)

col_size(i)

Data length of each column in table to be processed (bytes)

For details about the data length of each column, see Table 6‒9: Data length of each data type.

imp_load_rthd

Use the following formula to determine the value:

value-specified-for-import-option-adb_import_rthd_num - 1