DB2 Version 9.7 for Linux, UNIX, and Windows

Asynchronous index updates

To improve performance, a text search index is not synchronized with its associated user table within the scope of a DB2® transaction that updates, deletes text documents from, or inserts text documents into that table. Instead, text search indexes are updated asynchronously.

To facilitate the asynchronous update of a text search index, a staging table (also known as a log table), is created for each text search index. Triggers on the text table capture any changes, for example, inserts, deletes, or updates, to a text column that the text search index is associated with and write them to the staging table. The updates to the text search index are applied at a later stage, during either a manual update or an automatic update. The update is made to a copy of a very small part of the index. During the update, you can still perform searches on the index, but you cannot access the updated text search index until the synchronization is complete.

When using the updateautocommit option, consider that each commit cycle results in significant memory usage, which increases the total time for completing an index update. Setting a commitcount is especially useful for initial updates, or updates that involve all rows or a majority of rows, if the total elapsed time is large to avoid losing completed work due to a rollback caused by a system or server failure.

To calculate a commitcount value, consider that calculations for text index processing are very different from in-database transactions. Each cycle is treated as a complete index update and therefore executes preparation and closing steps, including necessary index segment merges or index reorganizations. Very short commit cycles will therefore significantly increase total elapsed time and should be avoided.

Examples

Example 1: With an average document size of 10k per row, a throughput on the specific system of 12 GB/hr, and a total of 240 GB to process, an index update without commit cycles requires about 20 hours, processing 1,200,000 rows/h and a commitcount might be set between 2000000 and 2500000 for a commit every 2 hours.

Example 2: With an average document size of 100b per row, a throughput of 1 GB/hr on a specific machine, and a total of 60 GB to process, an index update without commit cycles requires about 60 hours, processing 10,000,000 rows/hr and a commitcount of 30,000,000 may strike a balance.