ALTER INDEX

Function

Modifies the definition of an existing index.

Precautions

Syntax

Parameter Description

Examples

Rename the existing index ds_ship_mode_t1_index1 to tpcds. ds_ship_mode_t1_index5. The original schema name tpcds is prefixed to the new name.

1
ALTER INDEX tpcds.ds_ship_mode_t1_index1 RENAME TO tpcds.ds_ship_mode_t1_index5;

Set the ds_ship_mode_t1_index2 index as unusable:

1
ALTER INDEX tpcds.ds_ship_mode_t1_index2 UNUSABLE;

Rebuild the ds_ship_mode_t1_index2 index:

1
ALTER INDEX tpcds.ds_ship_mode_t1_index2 REBUILD;

Rename a partitioned table index:

1
ALTER INDEX tpcds.ds_customer_address_p1_index2 RENAME PARTITION CA_ADDRESS_SK_index1 TO CA_ADDRESS_SK_index4;

Modify the index comment:

1
ALTER INDEX tpcds.ds_customer_address_p1_index2 COMMENT 'comment_ds_customer_address_p1_index2';

Links

CREATE INDEX, DROP INDEX, REINDEX