ALTER INDEX

2023-10-24 09:23:03  Updated

Purpose

You can use this statement to modify the name or degree of parallelism (DOP) of an index.

Syntax

ALTER INDEX [ schema. ]index_name
    { parallel_clause
     RENAME TO new_name
    };

parallel_clause:
    { NOPARALLEL  PARALLEL integer }

Parameters

Parameter Description
schema. The schema where the index to be modified is located. If schema. is omitted, the index is in your own schema by default.
index_name The name of the index to be modified.
new_name The new name of the index.
parallel_clause The DOP of queries on the index.
  • NOPARALLEL: indicates serial execution with a DOP of 1, which is the default value.
  • PARALLEL integer: indicates parallel execution with a DOP specified by the integer parameter. The value of integer is an integer greater than or equal to 1.

Examples

  • Change the DOP of the tbl1_index1 index to 3.

    obclient> ALTER INDEX tbl1_index1 PARALLEL 3;
    Query OK, 0 rows affected
    
  • Change the name of the tbl1_index1 index to tbl1_index2.

    obclient>  ALTER INDEX tbl1_index1 RENAME TO tbl1_index2;
    Query OK, 0 rows affected
    

Contact Us