Hitachi

Hitachi Advanced Database Setup and Operation Guide


6.18 Estimating the size of a file output by the adbexport command

This section describes how to determine the size of a data file that is output by the adbexport command.

To determine the total size of data files that are output (EXPORTFILESIZE), use the following formula.

Formula (kilobytes)

EXPORTFILESIZE = ↑(HEADERSIZE × file_num + ROWSIZE × row_num) ÷ 1,024↑

Explanation of variables

HEADERSIZE

Size of the column names to be output to the output data file

Add this value if you specify the --with-column-name option when running the adbexport command. If you do not specify the --with-column-name option, substitute 0.

Use the following formula to determine its value.

Formula (bytes)

HEADERSIZE = 202 × column_num
column_num

Number of columns of the data to be output

file_num

Number of output data files specified in the output data path file

ROWSIZE

Data size of one row

Use the following formula to determine its value.

Formula (bytes)

[Figure]

column_data_size(k)

Column data length of the k-th column

The value to be substituted for the column_data_size variable differs depending on the data type of the column data. See the following table, and substitute the applicable value.

Table 6‒26: Value to be substituted for column_data_size

No.

Classification

Data type

Data length (bytes)

1

Numeric data

INTEGER

20

2

SMALLINT

11

3

DECIMAL(m, n)#

m + 2

4

DOUBLE PRECISION

24

5

Character string data

CHARACTER(n)

2 × n + 2

6

VARCHAR(n)

2 × d + 2

7

Datetime data

DATE

12

8

TIME(p)

11 + p

9

TIMESTAMP(p)

22 + p

10

Binary data

BINARY(n)

2 × n + 2

11

VARBINARY(n)

2 × d + 2

Legend:

m, n: Positive integers

p: 0, 3, 6, 9 or 12

d: Actual data length

#

Indicates a fixed-point number that has a total of m digits, with n digits following the decimal point. If m is omitted, 38 is assumed.

row_num

Number of rows output by the adbexport command