Hitachi

Hitachi Advanced Database Setup and Operation Guide


6.12.8 Determining the size of the user logs that are output during execution of the TRUNCATE TABLE statement (variable max_user_log)

Use the following formula to determine the size of the user logs that are output during execution of the TRUNCATE TABLE statement.

Formula (bytes)

[Figure]

Explanation of variables

dbarea_file_num

Number of DB area files in data DB area that stores the base table to be processed

SGDATA

Number of data DB area segments that store the base table to be processed

SEGBF

Number of segment block factors in the data DB area that stores the base table to be processed

page_size

Page size of the data DB area that stores the base table to be processed (bytes)

usrlog_file_num

Use the following formula to determine its value.

[Figure]

TRUNCLOCLOG

Location table update log

Use the following formula to determine this value.

If the table to be processed is not an archivable multi-chunk table, substitute 0. Also, if no archived chunks exist in the table to be processed, substitute 0.

Formula (bytes)

[Figure]

DELLOG

Determine the value from the formula in Size of user logs that are output when a DELETE statement is executed in 6.12.7 Determining the size of the user logs that are output during database updating (variable max_user_log). Note that for some of the variables in the formula, you must substitute values that are different from the values indicated in the preceding section. The following shows the relevant variables and the values to be substituted.

VRWLOG

Substitute 0.

IDXSLOG

To determine the value of the variable IDXSLOG, see (3) Determining the size of the B-tree index user log in 6.12.7 Determining the size of the user logs that are output during database updating (variable max_user_log). Note that for some of the variables in the formula, you must substitute values that are different from the values indicated in the preceding section. The following shows the relevant variables and the values to be substituted.

  • idx_num

    Substitute 1.

  • IDXLOG(i)

    Use the following formula to determine this value.

    Formula

    [Figure]

LROWNUM

Number of archive files created by the adbarchivechunk command

Use the formula for the variable LROWNUM in (f) Determining the variable SGROWTBL (for a multi-chunk table) under (2) Explanation of variables in 5.8.1 Determining the total number of pages in the data DB area. Note that for some of the variables in the formula, you must substitute values that are different from the values indicated in the preceding section. The following shows the relevant variables and the values to be substituted.

  • archive_chunk_num

    Substitute 1.

  • merge_chunk_num

    Substitute 0.

LBP

Use the formula for the variable LBP(i) in (f) Determining the variable SGROWTBL (for a multi-chunk table) under (2) Explanation of variables in 5.8.1 Determining the total number of pages in the data DB area. Note that for some of the variables in the formula, you must substitute values that are different from the values indicated in the preceding section. The following shows the relevant variables and the values to be substituted.

  • LROWNUM

    Substitute the same value as the variable LROWNUM determined before.

page_size

Page size of the data DB area that stores the archivable multi-chunk table (bytes)

del_row_num

Substitute the same value as the variable LROWNUM determined before.

For details about the number of segments in a data DB area and the segment block factors, see (2) Explanation of variables in 5.8.1 Determining the total number of pages in the data DB area.

For details about the number of user log files required during execution of the TRUNCATE TABLE statement, see (1) SQL statements for which the number of user log files needs to be estimated in 6.12.15 Determining the number of user log files.

If indexes are defined for the base table on which the TRUNCATE TABLE statement is to be executed, use the formula below to determine the value for each index. Then, add the determined values to the result of the above formula.

Formula (when an index is defined for the base table) (bytes)

[Figure]

Explanation of variables

dbarea_file_num

Number of DB area files in data DB area that stores the indexes to be processed

SGIDX

Number of segments in the data DB area that stores the indexes to be processed

SEGBF

Number of segment block factors in the data DB area that stores the indexes to be processed

page_size

Page size of the data DB area that stores the indexes to be processed (bytes)

usrlog_file_num

Use the following formula to determine its value.

[Figure]

For details about the number of segments in a data DB area and the segment block factors, see (2) Explanation of variables in 5.8.1 Determining the total number of pages in the data DB area.

For details about the number of user log files required during execution of the TRUNCATE TABLE statement, see (1) SQL statements for which the number of user log files needs to be estimated in 6.12.15 Determining the number of user log files.