11.4.2 Storing data in a multi-chunk table (background import)
This subsection explains how to store data in a multi-chunk table by using background import.
- Note
-
In addition to using background import, you can also use a method that stores data in a multi-chunk table in addition mode. For details about data import in addition mode, see 11.1.7 Storing data in a base table (data import).
To perform background import, execute the adbimport command with the -b option specified. The following shows an example of performing background import by specifying the -b option for the adbimport command.
For the specification format of the adbimport command, see adbimport (Import Data) in the manual HADB Command Reference.
- ■ Background import execution example
-
The HADB user (ADBUSER01) executes background import on the shop table (SHOPSLIST).
adbimport -u ADBUSER01 -p '#HelloHADB_01' -k "'" -s , -g 10 -w /home/adbmanager/tmp -z /home/adbmanager/imp_file/imp_opt_file.txt -b -m '2014/01/01-2014/01/31' SHOPSLIST /home/adbmanager/imp_file/imp_data_path.txt
- Note
-
- ■ Adding a comment to a chunk
-
When you import data into a multi-chunk table, you can add a comment to the chunk that will store the data. You use the -m option to add a comment.
When the operation targets a specific chunk, adding a comment to that chunk will make it easier to identify the target chunk.
- Important
-
When you perform background import, for the adb_import_rthd_num import option, specify a value that satisfies the following formula. Specifying a value that satisfies the following formula for the adb_import_rthd_num import option will improve the data storage efficiency.
Formula
value-specified-for-import-option-adb_import_rthd_num ≤ ↑ MIN ( C × db_org , db_org × index_num × 0.25 ) ↑ + 1
Explanation of the variables
- C
-
If the background import target table is a row store table, substitute 2. If the target table is a column store table, substitute 0.5.
- db_org
-
File size of the input data file to be used for background import (gigabytes)
- index_num
-
Number of B-tree indexes and text indexes that are defined for the background import target table
When background import executes, HADB creates a new chunk and stores the import data in that chunk. The following figure shows where data is stored by background import.
- Explanation
-
When the adbimport command is executed with the background-import facility, data is stored in newly created chunk 3. During this processing, the current chunk is changed from chunk 2 to chunk 3.
While data is being stored in chunk 3, you can retrieve the data stored in chunk 1 and chunk 2.
- Important
-
Each time background import is executed, a new chunk is created. Consequently, repeating background import increases the number of chunks. When the number of chunks increases, performance might decline during retrieval processing using B-tree indexes and text indexes. Therefore, consider reducing the number of chunks by merging them. To merge chunks, see 11.4.9 Merging chunks (to reduce the number of chunks).