doc-exports/docs/dws/tool/dws_16_0174.html
Lu, Huayi 27019c2991 DWS TOOL 830.201 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-16 07:35:25 +00:00

3.3 KiB

Renaming an Index

DSC supports renaming indexes. Prefix a table name to an index name to prevent name conflicts. (Only DDL statements with specific index names can be created. Currently, the name of a renamed index cannot be deleted. Exercise caution when modifying this parameter.)

Modifying the configuration

Open Table 1 Configuration parameters in the features-mysql.properties file and change the value of the following parameter to true: The default value is false, indicating that the file will not be renamed.

# Whether to rename an index when creating the index.
table.index.rename=true

Input

CREATE TABLE IF NOT EXISTS `CUSTOMER`(    
    `NAME` VARCHAR(64) PRIMARY KEY,   
    ID INTEGER,   
    ID2 INTEGER);
CREATE INDEX ID_INDEX USING BTREE ON CUSTOMER (ID);
ALTER TABLE CUSTOMER ADD INDEX ID3_INDEX(ID2);

Output

CREATE TABLE IF NOT EXISTS "public"."customer" ( 
    "name" VARCHAR(256) PRIMARY KEY,  
    "id" INTEGER,  
    "id2" INTEGER) WITH (ORIENTATION = ROW, COMPRESSION = NO) NOCOMPRESS DISTRIBUTE BY HASH ("name");
CREATE INDEX customer_id_index ON "public"."customer" USING BTREE ("id");
CREATE INDEX customer_id3_index ON "public"."customer" ("id2");