This procedure is used to change the update characteristics of an index.
The procedure issues an ALTER INDEX text search administration command on the database server.
None
>>-SYSTS_ALTER--(--index_schema--,--index_name--,---------------> >--| update characteristics |-----------------------------------> >--| options |--,--message_locale--,--message--)-------------->< update characteristics |--+--------------------------------------------+---------------> '-UPDATE FREQUENCY--+-NONE-----------------+-' '-| update frequency |-' >--+----------------------------+-------------------------------| '-UPDATE MINIMUM--minchanges-' update frequency |--D-(-+-*------------+-)--H-(-+-*------------+-)---------------> | .-,--------. | | .-,--------. | | V | | | V | | '---integer1-+-' '---integer2-+-' .-,--------. V | >--M-(---integer3-+-)-------------------------------------------| options |--+----------------------------------+-------------------------| +-| index configuration options |-+ '-| activation options |-----------' index configuration options |--+-------------------------------------------+----------------| '-INDEX CONFIGURATION--(-| option-value |-)-' option-value |--+----------------------------------------------+-------------| +-UPDATEAUTOCOMMIT--+-+--------------------+-+-+ | | '-commitcount_number-' | | | '-+------------+---------' | | '-commitsize-' | +-COMMITTYPE--committype-----------------------+ '-COMMITCYCLES--commitcycles-------------------' activation options |--+-----------------------------------+------------------------| SET--+-ACTIVE---+--+------------+---' '-INACTIVE-' '-UNILATERAL-'
The schema is SYSPROC.
The default frequency value is taken from the view SYSIBMTS.TSDEFAULTS, where DEFAULTNAME='UPDATEFREQUENCY'.
If you do not specify the UPDATE FREQUENCY option, the frequency settings are unchanged.
Option | Value | Data type | Description |
---|---|---|---|
SERIALUPDATE | updatemode | Integer | Specifies whether the update processing for
a partitioned text search index must be run in parallel or in serial
mode. In parallel mode the execution is distributed to the database
partitions and issues independently on each node. In serial mode the
execution is run without distribution and stops when a failure is
encountered. Serial mode execution usually takes longer but requires
less resources.
|
UPDATEAUTOCOMMIT | commitsize | String | 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:
If
you specify the number of hours:
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. |
COMMITTYPE | committype | String | Specifies rows or hours for the UPDATEAUTOCOMMIT index configuration option. The default is rows. |
COMMITCYCLES | commitcycles | Integer | Specifies the number of commit cycles. The default
is 0 for unlimited cycles. If you do not explicitly specify cycles, the update operation uses as many cycles as required based on the batch size that you specified with the UPDATEAUTOCOMMIT option to finish the update processing. You can use this option with the UPDATEAUTOCOMMIT setting with a committype. |
Example 1: In the following example, the update characteristics of a text search index are being altered. This index was originally created with index_schema 'db2ts' and index_name 'myTextIndex'. By using 'UPDATE FREQUENCY NONE', the intention is to make no further updates to the text search index as possibly no changes are expected for the associated table column. Any error messages are requested to be returned in English. When the procedure is complete, a success message is returned to the caller.
CALL SYSPROC.SYSTS_ALTER('db2ts', 'myTextIndex',
'UPDATE FREQUENCY NONE', 'en_US', ?)
Value of output parameters
--------------------------
Parameter Name : MESSAGE
Parameter Value : Operation completed successfully.
Return Status = 0
Example 2: In the following example, the SYSTS_ALTER stored procedure is called to alter the update-characteristics for a text search index with index_schema 'db2ts' and index_name 'myTextIndex2'. The intention is to ensure that updates to the index occur every hour on the hour. However, in this example the index does not exist and results in an error.
CALL SYSPROC.SYSTS_ALTER('db2ts', 'myTextIndex2',
'update frequency D(*) H(*) M(0)', 'en_US', ?)
SQL20427N An error occurred during a text search administration
procedure or command. The error message is "CIE00316 Text search
index "db2ts"."myTextIndex2" does not exist. ". SQLSTATE 38H14
Initial DB2 Text Search or Net Search Extender Status | Request Active | Request Active Unilateral | Request Inactive | Request Inactive Unilateral |
---|---|---|---|---|
Active / Inactive | No change | No change | Inactive / Active | Inactive / Inactive |
Inactive / Active | Active / Inactive | Error | No change | No change |
Inactive / Inactive | Active / Inactive | Active / Inactive | Inactive / Active | No change |
You can specify the UPDATEAUTOCOMMIT index configuration option without type and cycles for compatibility with an earlier version. This index configuration option is associated by default with the COMMITTYPE rows option and unrestricted cycles.
The UPDATEAUTOCOMMIT, COMMITTYPE, and COMMITSIZE index configuration options are also specified for an UPDATE INDEX operation to override the configured values. Values that you submit for a specific update operation are applied only once and not persisted.