Entering content frame

ALTER INDEX Statement (alter_index_statement) Locate the document in the library structure

The ALTER INDEX statement (alter_index_statement) determines how an index is used in data queries.

Syntax

<alter_index_statement> ::= ALTER INDEX <index_name> [ON <table_name>] ENABLE
| ALTER INDEX <index_name> [ON <table_name>] DISABLE
| ALTER INDEX <index_name> [ON <table_name>] INIT USAGE

Explanation

If a schema is not specified in the table name, the current schema is assumed implicitly.

When a CREATE INDEX statement is executed, an index is generated across the specified columns. This index is modified accordingly for all subsequent SQL statements for manipulating data (INSERT statement, UPDATE statement, DELETE statement). With all other SQL statements in which individual rows in a table are specified, the database system can use this index to speed up the search for these rows.

ALTER INDEX … DISABLE

The index can no longer be used for this search, however it continues to be changed when the SQL statements INSERT, UPDATE, or DELETE are used.

ALTER INDEX … ENABLE

The index can be used for the search again.

ALTER INDEX … INIT USAGE

The INDEX_USED column in the system table DOMAIN.INDEXES is initialized with 0, in other words, the mechanism that counts how often an index is used is restarted.

 

Leaving content frame