数据仓库服务 GaussDB(DWS)-ALTER INDEX:示例

时间:2023-11-01 16:16:26

示例

重命名现有的索引ds_ship_mode_t1_index1为tpcds.ds_ship_mode_t1_index5,新的索引名字前ds_ship_mode_t1_index5带有原索引所在的schema名tpcds:

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

设置索引ds_ship_mode_t1_index2不可用:

1
ALTER INDEX tpcds.ds_ship_mode_t1_index2 UNUSABLE;

重建索引ds_ship_mode_t1_index2:

1
ALTER INDEX tpcds.ds_ship_mode_t1_index2 REBUILD;

重命名分区表索引:

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

修改索引的注释:

1
ALTER INDEX tpcds.ds_customer_address_p1_index2 COMMENT 'comment_ds_customer_address_p1_index2';
support.huaweicloud.com/sqlreference-820-dws/dws_06_0128.html