Hitachi

Hitachi Advanced Database Setup and Operation Guide


6.3.17 Determining the memory requirement for executing the adbunarchivechunk command

When the adbunarchivechunk command is executed, the HADB server uses the following types of memory. Determine the requirement for each type of memory.

▪ Shared memory
  • Process common memory (PROC_UNARCSZ)

  • Real thread private memory (RTHD_UNARCCKSZ)

▪ Process memory
  • Heap memory (HEAP_UNARCCKSZ)

The following subsections describe the formulas for determining the required amounts of these types of memory.

Organization of this subsection

(1) Determining the process common memory requirement (for executing the adbunarchivechunk command)

Use the following formula to determine the process common memory (PROC_UNARCSZ) required for executing the adbunarchivechunk command.

Formula (kilobytes)

[Figure]

#1

Add this value if you execute the adbunarchivechunk command for a table for which a B-tree index has been defined.

#2

Add this value if you execute the adbunarchivechunk command for a table for which a range index has been defined.

#3

Add this value if the number of archive files for the target chunk exceeds 1,024.

#4

If you execute the adbunarchivechunk command for multiple chunks, determine the memory requirement for each chunk. Then, add the largest of the determined values to this variable.

#5

If you execute multiple adbunarchivechunk commands concurrently, determine the memory requirement for each adbunarchivechunk command. Then, add up the total memory requirements.

Explanation of variables

PROC_UNARCCON

Determine the value as explained in (a) Determining the variable PROC_UNARCCON.

PROC_UMAC

Determine the value as explained in (b) Determining the variable PROC_UMAC.

PROC_IDX

Determine the value as explained in (c) Determining the variable PROC_IDX.

PROC_IDXBUILD

Determine the value as explained in (d) Determining the variable PROC_IDXBUILD.

PROC_RNGIDX

Determine the value as explained in (e) Determining the variable PROC_RNGIDX.

PROC_INFILE

Determine the value as explained in (f) Determining the variable PROC_INFILE.

PROC_DBUPDINF

Determine the value as explained in (g) Determining the variable PROC_DBUPDINF.

PROC_RTHDUPDINF

Determine the value as explained in (h) Determining the variable PROC_RTHDUPDINF.

(a) Determining the variable PROC_UNARCCON

Use the following formula to determine the value of variable PROC_UNARCCON.

Formula (kilobytes)

[Figure]

#

Add this value when the audit trail facility is enabled.

Explanation of variables

PROC_AUDINFSZ

Determine the value of the variable PROC_AUDINFSZ according to (r) Determining the variable AUDINF in (3) Determining the process common memory requirement (for starting the HADB server) under 6.3.3 Determining the memory requirement for starting the HADB server.

(b) Determining the variable PROC_UMAC

Use the following formula to determine the value of variable PROC_UMAC.

Formula (kilobytes)

[Figure]

Explanation of variables

DIC

See the explanation of the variable DIC in (a) Determining the variable PROC_IMPT in (1) Determining the process common memory requirement (for executing the adbimport command) in 6.3.6 Determining the memory requirement for executing the adbimport command.

IOA

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

max_rowsz

Maximum row length (bytes)

Determine the maximum row length based on the formula for the row length ROWSZ in (1) Determining the number of pages for base rows (variable BP(i)) under 5.8.2 Determining the number of pages for storing each type of row.

col_num

Number of columns in the table to be processed

idx_num

Number of indexes defined for the table to be processed

dba_num

Number of DB area files for the DB areas that store the table to be processed

load_rthd

Use the following formula to determine the value:

value-specified-for-unarchive-chunk-option-adb_unarcv_rthd_num - 1
LOD

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

#

If you have added columns after the chunk has been archived, add the information about the added columns.

read_size

Value specified for the unarchive chunk option adb_unarcv_read_size

read_buff_num

Substitute 3.

decomp_buff_size

Value specified for the unarchive chunk option adb_unarcv_decompress_buff_size

load_rthd

Use the following formula to determine the value:

value-specified-for-unarchive-chunk-option-adb_unarcv_rthd_num - 1
input_file_num

Substitute 1,024.

input_edit_area

Use the following formula to determine this value.

Formula

[Figure]

input_recsize

Use the following formula to determine this value.

Formula

[Figure]

Σ(DATASIZE)

Sum of the largest data lengths (in character format) for the data types of all columns in the processing-target table

Determine the largest data length of each data type in character format from the following table.

Table 6‒14: Largest data length in character format for each data type

No.

Classification

Data type

Largest data length in character format

1

Numeric data

INTEGER

23

2

SMALLINT

13

3

DECIMAL(m,n)

m + 5

4

DOUBLE PRECISION

511

5

Character string data

CHAR(n)

n × 2 + 2

6

VARCHAR(n)

n × 2 + 2

7

Datetime data

DATE

12

8

TIME(p)

8 + p + 3

9

TIMESTAMP(p)

19 + p + 3

10

Binary data

BINARY(n)

n × 8 + 2

11

VARBINARY(n)

n × 8 + 2

Legend:

m, n, p: See the topic List of data types in the manual HADB SQL Reference.

IMPORTBUF_CTL

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

BUFBLK

For details, see the description of the variable BUFBLK in (f) Determining the variable PROC_UPDSZ under (1) Determining the process common memory requirement (during normal operation) in 6.3.4 Determining the memory requirement during normal operation.

load_rthd

Use the following formula to determine the value:

value-specified-for-unarchive-chunk-option-adb_unarcv_rthd_num - 1
STS

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

idx_num

Number of indexes defined for the table to be processed

b_tree_idx_num

Number of B-tree indexes defined for the table to be processed

range_idx_num

Number of range indexes defined for the table to be processed

load_rthd

Use the following formula to determine the value:

value-specified-for-unarchive-chunk-option-adb_unarcv_rthd_num - 1
text_idx_num

Number of text indexes defined for the table to be processed

PAGEALLOC

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

unarcv_rthd

Use the following formula to determine the value:

value-specified-for-unarchive-chunk-option-adb_unarcv_rthd_num - 1

(c) Determining the variable PROC_IDX

Use the following formula to determine the value of variable PROC_IDX.

Formula (kilobytes)

[Figure]

Explanation of variables

idxf_buff_size

Substitute 1,024.

KEYSZ

Key length of a B-tree index (bytes)

Determine the key length of the 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. If multiple B-tree indexes have been defined for the processing-target table, use the largest key length among all the B-tree indexes.

idx_num

Number of B-tree indexes defined for the table to be processed

load_rthd

Use the following formula to determine the value:

value-specified-for-unarchive-chunk-option-adb_unarcv_rthd_num - 1
cmd_d_opt

Substitute 1.

rd_buff_size

Value specified for the unarchive chunk option adb_unarcv_dividx_rd_buff_size

ld_buff_size

Value specified for the unarchive chunk option adb_unarcv_dividx_wt_buff_size

CTRL
  • If the indexed columns are fixed-length columns

    Substitute 10 bytes.

  • If the indexed columns include variable-length columns

    Substitute 12 bytes.

text_idx_num

Number of text indexes defined for the table to be processed

dividx_rthd

Use the following formula to determine the value:

value-specified-for-unarchive-chunk-option-adb_unarcv_rthd_num - 1

(d) Determining the variable PROC_IDXBUILD

Use the following formula to determine the variable PROC_IDXBUILD.

Formula (kilobytes)

[Figure]

Explanation of variables

PROC_IDXCREATE: Use the following formula to determine its value.

Formula (kilobytes)

[Figure]

idx_num

Number of B-tree indexes defined for the table to be processed

PROC_IDXCREATE_MEM(k)

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

idx_col_num

Number of B-tree indexed columns

idx_lv

Number of levels in the B-tree index

Calculate the recursion formula 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 and substitute the value of n when PIDX(n) results in 1.

Note that in the case of PIDX(1) = 1, the number of levels in the B-tree index is 2.

dividx_rthd

Use the following formula to determine the value:

value-specified-for-unarchive-chunk-option-adb_unarcv_rthd_num - 1
KEYSZ

Key length of a B-tree index (bytes)

Determine the key length of the 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.

page_size

Page size of the data DB area in which the B-tree index is defined (bytes)

Determine this value based on the explanation of the page size of the data DB area in Table 6‒3: DB area page size under (2) Determining the global buffer page requirement (for starting the HADB server) in 6.3.3 Determining the memory requirement for starting the HADB server.

(e) Determining the variable PROC_RNGIDX

Use the following formula to determine the variable PROC_RNGIDX.

Formula (kilobytes)

[Figure]

Explanation of variables

rngidx_num

Number of range indexes defined for the table to be processed

(f) Determining the variable PROC_INFILE

If the number of archive files for one chunk exceeds 1,024, you must add the variable PROC_INFILE. Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

Explanation of variables

INFMAX

Number of archive files for the chunk

(g) Determining the variable PROC_DBUPDINF

Use the following formula to determine the value of variable PROC_DBUPDINF. Note that the formula to be used differs depending on whether the multi-node function is used.

Formula to be used when the multi-node function is not used (kilobytes)

[Figure]

Formula to be used when the multi-node function is used (kilobytes)

[Figure]

Explanation of variables

DBUPDINF_ENT_NUM

Use the following formula to determine this value.

Formula (count)

[Figure]

archive_file_num

Specify the number of archive files for the archived chunk.

Use the adbdbstatus command to output the summary information of archived chunks, and then check the value of Archive_file_num for each chunk. For details about Archive_file_num, see the following section in the manual HADB Command Reference: List of items that are output in the summary information of archived chunks in Items that are output in the summary information of archived chunks in adbdbstatus (Analyze the Database Status).

(h) Determining the variable PROC_RTHDUPDINF

Use the following formula to determine the variable PROC_RTHDUPDINF.

Formula (kilobytes)

[Figure]

Explanation of variables

rthd_num

Use the following formula to determine this value.

value-specified-for-unarchive-chunk-option-adb_unarcv_rthd_num - 1

(2) Determining the real thread private memory requirement (for executing the adbunarchivechunk command)

Use the following formula to determine the amount of real thread private memory (RTHD_UNARCCKSZ) required to execute the adbunarchivechunk command.

Formula (kilobytes)

[Figure]

#1

Add this value if you execute the adbunarchivechunk command for a table for which a B-tree index has been defined.

#2

Add this value if you execute the adbunarchivechunk command for a table for which a range index has been defined.

#3

Add this value if you execute the adbunarchivechunk command for a table for which a text index has been defined.

Explanation of variables

IMPORTBUF

Determine the value as explained in (a) Determining the variable IMPORTBUF.

SORTIOBUF

Determine the value as explained in (b) Determining the variable SORTIOBUF.

SORTBUF

Determine the value as explained in (c) Determining the variable SORTBUF.

RTHD_DATALOAD

Determine the value as explained in (d) Determining the variable RTHD_DATALOAD.

RTHD_IDXREC

Determine the value as explained in (e) Determining the variable RTHD_IDXREC.

RTHD_IDXBUILD

Determine the value as explained in (f) Determining the variable RTHD_IDXBUILD.

RTHD_RNGIDX

Determine the value as explained in (g) Determining the variable RTHD_RNGIDX.

RTHD_TXTIDX

Determine the value as explained in (h) Determining the variable RTHD_TXTIDX.

RTHD_ARCDIRPATH

Determine the value as explained in (i) Determining the variable RTHD_ARCDIRPATH.

(a) Determining the variable IMPORTBUF

Use the following formula to determine the variable IMPORTBUF.

Formula (kilobytes)

[Figure]

Explanation of variables

IMP_SQBLK

Use the following formula to determine this value.

Formula (bytes)

[Figure]

imp_blknum

Value specified for the unarchive chunk option adb_unarcv_buff_blk_num

IMP_BLKSZ

Use the following formula to determine this value.

Formula

[Figure]

imp_pagesize

The smallest of the page sizes of the following DB areas (bytes):

  • DB area storing the processing-target table

  • DB area storing the B-tree index or text index that is defined for the processing-target table

Determine this value based on the explanation of the page size of the data DB area in Table 6‒3: DB area page size under (2) Determining the global buffer page requirement (for starting the HADB server) in 6.3.3 Determining the memory requirement for starting the HADB server.

IMP_SQIO

Use the following formula to determine this value.

Formula (bytes)

[Figure]

imp_blknum

Value specified for the unarchive chunk option adb_unarcv_buff_blk_num

IMP_SQPGE

Use the following formula to determine this value.

Formula (bytes)

[Figure]

imp_pagesize

The smallest of the page sizes of the following DB areas (bytes):

  • DB area storing the processing-target table

  • DB area storing the B-tree index or text index that is defined for the processing-target table

Determine this value based on the explanation of the page size of the data DB area in Table 6‒3: DB area page size under (2) Determining the global buffer page requirement (for starting the HADB server) in 6.3.3 Determining the memory requirement for starting the HADB server.

BUFLOG

For details, see the description of the variable BUFLOG in (d) Determining the variable BUFGLOBAL under (3) Determining the process common memory requirement (for starting the HADB server) in 6.3.3 Determining the memory requirement for starting the HADB server.

IMP_BLKSZ

Use the following formula to determine this value.

Formula

[Figure]

imp_blknum

Value specified for the unarchive chunk option adb_unarcv_buff_blk_num

IMP_SQHS

Use the following formula to determine this value.

Formula (bytes)

[Figure]

imp_blknum

Value specified for the unarchive chunk option adb_unarcv_buff_blk_num

(b) Determining the variable SORTIOBUF

Use the following formula to determine the variable SORTIOBUF.

Formula (kilobytes)

[Figure]

Explanation of variables

sort_io_buff_size

Substitute 16.

sort_rthd

Use the following formula to determine the value:

value-specified-for-unarchive-chunk-option-adb_unarcv_rthd_num - 1

(c) Determining the variable SORTBUF

Use the following formula to determine the variable SORTBUF.

Formula (kilobytes)

[Figure]

Explanation of variables

sort_rthd

Use the following formula to determine the value:

value-specified-for-unarchive-chunk-option-adb_unarcv_rthd_num - 1
sort_buff_size

Value specified for the unarchive chunk option adb_unarcv_sort_buff_size#

#

A work file is created during sort processing. The formula for the variable sort_buff_size, which minimizes the size of this file, is shown later. Make sure that the variable sort_buff_size meets the following formula. However, if you are running out of memory or if most data items are already arranged in index key order, do not specify more space than is necessary.

Formula

[Figure]

REC_SIZE

Use the following formula to determine this value.

Formula

[Figure]

KEYSZ

Key length of a B-tree index (bytes)

Determine the key length of the 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. If multiple B-tree indexes have been defined for the table to be processed, use the largest key length among all the B-tree indexes.

SYS1
  • If the indexed columns of the indexes defined for the table to be processed are fixed-length:

    Substitute 10.

  • If any of the indexed columns of the indexes defined for the table to be processed are variable-length:

    Substitute 12.

SYS2
  • If any of the indexes defined for the table to be processed are variable-length multiple-column indexes:

    Use the following formula to determine this value.

    Formula

    [Figure]

  • For all other indexes:

    Substitute 0.

BLK

Use the following formula to determine this value.

Formula

[Figure]

row_num

Number of rows to be stored in the table by the adbunarchivechunk command

KEY_INF

Use the following formula to determine this value.

Formula

[Figure]

COL_INFO

Use the following formula to determine this value.

Formula

[Figure]

MULTI_KEY_INFO
  • If any of the B-tree indexes defined for the table to be processed are variable-length multiple-column indexes:

    Use the following formula to determine this value.

    Formula

    [Figure]

  • For all other indexes:

    Substitute 5.

(d) Determining the variable RTHD_DATALOAD

Use the following formula to determine the variable RTHD_DATALOAD.

Formula (kilobytes)

[Figure]

#1

Add this value if a range index is defined for the table to be processed.

#2

Add this value when the table to be processed is not a FIX table.

Explanation of variables

col_num

Number of columns in the table to be processed

var_col_num

Number of VARCHAR-type and VARBINARY-type columns in the table to be processed

(e) Determining the variable RTHD_IDXREC

Use the following formula to determine the variable RTHD_IDXREC.

Formula (kilobytes)

[Figure]

Explanation of variables

idx_num

Number of B-tree indexes defined for the table to be processed

max_idx_col_num

Maximum number of indexed columns in the B-tree index defined for the table to be processed

buf_size

Substitute 1,024.

(f) Determining the variable RTHD_IDXBUILD

Use the following formula to determine the variable RTHD_IDXBUILD.

Formula (kilobytes)

[Figure]

Explanation of variables

idx_num

Number of B-tree indexes defined for the table to be processed

RTHD_IDXBUILD_MEM(k)

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

page_size

Page size of the data DB area in which the B-tree index is defined (bytes)

Determine this value based on the explanation of the page size of the data DB area in Table 6‒3: DB area page size under (2) Determining the global buffer page requirement (for starting the HADB server) in 6.3.3 Determining the memory requirement for starting the HADB server.

KEYSZ

Key length of a B-tree index (bytes)

Determine the key length of the 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
  • If all key lengths in the indexed columns are fixed:

    Substitute 10 bytes.

  • If some of the key lengths in the indexed columns are variable:

    Substitute 12 bytes.

(g) Determining the variable RTHD_RNGIDX

Use the following formula to determine the variable RTHD_RNGIDX.

Formula (kilobytes)

[Figure]

Explanation of variables

rngidx_num

Number of range indexes defined for the table to be processed

load_rthd

Use the following formula to determine the value:

value-specified-for-unarchive-chunk-option-adb_unarcv_rthd_num - 1

(h) Determining the variable RTHD_TXTIDX

Use the following formula to determine the variable RTHD_TXTIDX.

Formula (kilobytes)

[Figure]

Explanation of variables

idx_num

Number of text indexes defined for the table to be processed

RTHD_TXTIDXBUILD_MEM(k)

Use the following formula to determine this value.

Formula (kilobytes)

[Figure]

buff_blk_size

Substitute 4,096.

buff_blk_num

Value specified for the unarchive chunk option adb_unarcv_buff_blk_num

idx_div_num

Length defined for the indexed column for the k-th text index

txt_sort_buff_size

Value specified for the unarchive chunk option adb_unarcv_txt_buff_size

(i) Determining the variable RTHD_ARCDIRPATH

Substitute the following value for the variable RTHD_ARCDIRPATH.

Value (kilobytes)

[Figure]

(3) Determining the heap memory requirement (for executing the adbunarchivechunk command)

Use the following formula to determine the heap memory (HEAP_UNARCCKSZ) required to execute the adbunarchivechunk command.

Formula (kilobytes)

[Figure]

#

If you execute multiple adbunarchivechunk commands concurrently, determine the heap memory requirement for each adbunarchivechunk command. Then, add up the total heap memory requirements.

Explanation of variables

HEAP_ZLIB

Determine the value as explained in (a) Determining the variable HEAP_ZLIB.

HEAP_SRTHMEM

Determine the value as explained in (b) Determining the variable HEAP_SRTHMEM.

(a) Determining the variable HEAP_ZLIB

Use the following formula to determine the value of variable HEAP_ZLIB.

Formula (kilobytes)

[Figure]

Explanation of variables

load_rthd

Use the following formula to determine the value:

value-specified-for-unarchive-chunk-option-adb_unarcv_rthd_num - 1

(b) Determining the variable HEAP_SRTHMEM

Use the following formula to determine the value of variable HEAP_SRTHMEM.

Formula (kilobytes)

[Figure]

Explanation of variables

sort_rthd

Use the following formula to determine the value:

value-specified-for-unarchive-chunk-option-adb_unarcv_rthd_num - 1