db2ts UPDATE INDEX command
For execution, you must prefix the command with db2ts at the command line.
Authorization
- DATAACCESS authority
- CONTROL privilege on the table on which the text index is defined
- INDEX with SELECT privilege on the base table on which the text index is defined
Required connection
Database
Command syntax
Command parameters
- UPDATE INDEX index-name
- Specifies the name of the text search index to be updated. The index name must adhere to the naming restrictions for Db2® indexes.
- UPDATE OPTIONS
- An input argument of type VARCHAR(32K) that specifies update options.
If no options are specified the update is started unconditionally.
The possible values are:
UPDATE OPTIONS value Description USING UPDATE MINIMUM This option enforces the use of the UPDATE MINIMUM value that is defined for the text search index and processes updates if the specified minimum number of changes occurred. FOR DATA REDISTRIBUTION This option specifies that a text search index in a partitioned database must be refreshed after data partitions are added or removed and a subsequent data redistribution operation must be completed. Search results might be inconsistent until the text search index is updated with the FOR DATA REDISTRIBUTION option. ALLROWS This option specifies that an initial update must be attempted unconditionally. UPDATEAUTOCOMMIT commitsize Specifies the number of rows or number of hours after which a commit is run to automatically preserve the previous work for either initial or incremental updates.
If you specify the number of rows:- After the number of documents that are updated reaches the COMMITCOUNT number, the server applies a commit. COMMITCOUNT counts the number of documents that are updated by using the primary key, not the number of staging table entries.
If you specify the number of hours:- The text index is committed after the specified number of hours is reached. The maximum number of hours is 24.
For initial updates, the index update processes batches of documents from the base table. After the commitsize value is reached, update processing completes a COMMIT operation and the last processed key is saved in the staging table with operational identifier '4'. This key is used to restart update processing either after a failure or after the number of specified commitcycles are completed. If a commitcycles is specified, the update mode is modified to incremental to initiate capturing changes by using the LOGTYPE BASIC option to create triggers on the text table. However, until the initial update is complete, log entries that are generated by documents that have not been processed in a previous cycle are removed from the staging table.
Using the UPDATEAUTOCOMMIT option for an initial text index update leads to a significant increase of execution time.
For incremental updates, log entries that are processed are removed correspondingly from the staging table with each interim commit.
In a multi-partition database environment, the commitsize value specified is per node.
COMMITTYPEcommittype Specifies rows or hours for the UPDATEAUTOCOMMIT index configuration option. The default is rows.
COMMITCYCLEScommitcycles Specifies the number of commit cycles. The default is 0 for unlimited cycles.
If cycles are not explicitly specified, the update operation uses as many cycles as required based on the batch size that is specified with the UPDATEAUTOCOMMIT option to finish the update processing.
You can use this option with the UPDATEAUTOCOMMIT setting with a committype.
- CONNECT TO database-name
- This clause specifies the database to which a connection is established.
The database must be on the local system. If specified, this clause
takes precedence over the environment variable DB2DBDFT. You can omit
this clause if the following statements are all true:
- The DB2DBDFT environment variable is set to a valid database name.
- The user running the command has the required authorization to connect to the database server.
- USER username USING password
- This clause specifies the authorization name and password that are used to establish the connection.
Usage notes
[A-Za-z][A-Za-z0-9@#$_]*or"[A-Za-z ][A-Za-z0-9@#$_ ]*"If synonym dictionaries are created for
a text index, issuing the ALLROWS and FOR
DATA REDISTRIBUTION update options removes dictionaries from
existing collections. You can associate new collections with the text
index after database partitions are added. The synonym dictionaries
for all associated collections have to be added again.
The command does not complete sucessfully until all index update processing is completed. The duration depends on the number of documents to be indexed and the number of documents already indexed. You can retrieve the collection name from the SYSIBMTS.TSCOLLECTIONNAMES view (column COLLECTIONNAME).
- UPDATE INDEX
- CLEAR EVENTS FOR INDEX
- ALTER INDEX
- DROP INDEX
- DISABLE DATABASE FOR TEXT
- Insert rows to the event table (including parser error information from Db2 Text Search).
- Delete from the index staging table in case of incremental updates.
- Before first update, create triggers on the user text table.
- The collection is updated.
- New or changed documents are parsed and indexed.
- Deleted documents are discarded from the index.
You can specify the UPDATEAUTOCOMMIT index configuration option without type and cycles for compatibility with an earlier version. It is associated by default with the COMMITTYPE rows option and unrestricted cycles.
When you specify UPDATEAUTOCOMMIT, COMMITTYPE or COMMITSIZE values for the update operation, they override existing configured values only for the specific update and are not persisted.
