Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.3.0 |  CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 



ALTER INDEX

Description

Use the ALTER INDEX statement to rebuild an index. (That is, drop and rebuild an index.) There are the following two ways to specify an index to be rebuilt:

  • Specifying it as the name of the index
  • Specifying it as the name of the table or the column where the index is specified
Syntax

ALTER [ REVERSE ] [ UNIQUE ] INDEX index_name
[ON { ONLY } table_name ( column_name [ {, column_name } ...) ] REBUILD [ ; ]

ALTER [ REVERSE ] [ UNIQUE ] INDEX
ON { ONLY } table_name ( column_name [ {, column_name } ...) REBUILD [ ; ]

  • REVERSE : Creates an index in the reverse order. A reverse index helps to increase sorting speed in descending order.
  • UNIQUE : Creates an index with unique values.
  • index_name : Specifies the name of the index to be altered. The index name must be unique in the table.
  • table_name : Specifies the name of the table where the index is to be created.
  • column_name : Specifies the name of the column where the index is to be applied. To create a multiple column index, specify two or more column names.
Example

The following are examples of many ways of re-creating indexes:

ALTER INDEX i_game medal ON game(medal) REBUILD;

ALTER INDEX game_date_idx REBUILD;