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 |
The ALTER INDEX statement rebuilds an index. In other words, it drops and rebuilds an index. If a table name and a column name are added at the end of the ON clause, a new index is re-created with the table and column names.
ALTER [ REVERSE ] [ UNIQUE ] INDEX index_name
ON { ONLY } table_name <index_col_desc> REBUILD [ ; ]
<index_col_desc> ::=
( column_name[ {, column_name} ...] ) [ WHERE <filter_predicate> ]
| (function_name (argument_list) )
Note In versions lower than CUBRID 9.0, index names can be deleted; however, from the CUBRID 9.0 version, it is no longer supported.
The following is an example of re-creating indexes in various ways:
ALTER INDEX i_game_medal ON game(medal) REBUILD;
ALTER INDEX game_date_idx REBUILD;
ALTER INDEX char_idx ON athlete(gender, nation_code) WHERE gender='M' AND nation_code='USA' REBUILD;