11.4.3 Notes on retrieving and updating data in an archivable multi-chunk table
This subsection provides notes on retrieving and updating data in an archivable multi-chunk table.
- Organization of this subsection
(1) Retrieving rows with the SELECT statement
When you perform retrieval processing on an archivable multi-chunk table, the HADB server first narrows down the chunks to be accessed, based on the range in the archive range column for each chunk and the search conditions in the SELECT statement. When you retrieve data in an archived chunk, you cannot use an index for retrieval.
Therefore, to narrow down the chunks to be accessed during retrieval from an archivable multi-chunk table, in the SELECT statement, specify a search condition that uses the archive range column. For details, see Considerations when searching an archivable multi-chunk table in Designs Related to Improvement of Application Program Performance in the HADB Application Development Guide.
If the number of retrievals of data in an archived chunk temporarily grows, consider that you use the adbunarchivechunk command to release the archived state of the chunk.
(2) Inserting rows with the INSERT statement
No special considerations need be taken when executing the INSERT statement to insert a row into an archivable multi-chunk table. The inserted row data is stored in the current chunk.
(3) Updating rows with the UPDATE statement
You can use the UPDATE statement to update data in an unarchived chunk, but there are special rules for specifying the search conditions in the UPDATE statement. For details, see Rules in Specification format and rules for the UPDATE statement in the manual HADB SQL Reference.
Note that you cannot use the UPDATE statement to update data in an archived chunk. If you want to use the UPDATE statement to update data in an archived chunk, execute the adbunarchivechunk command to release the archived state of the chunk beforehand.
(4) Deleting rows with the DELETE statement
You can use the DELETE statement to delete data in an unarchived chunk, but there are special rules for specifying the search conditions in the DELETE statement. For details, see Rules in Specification format and rules for the DELETE statement in the manual HADB SQL Reference.
Note that you cannot use the DELETE statement to delete data in an archived chunk. If you want to use the DELETE statement to delete data in an archived chunk, execute the adbunarchivechunk command to release the archived state of the chunk beforehand.