Updated on 2024-10-09 GMT+08:00

DROP SECONDARY INDEX

Function

This command is used to delete a secondary index table from a specified table.

Syntax

DROP INDEX [IF EXISTS] index_name ON [db_name.]table_name;

Parameter Description

Table 1 Parameter parameters

Parameter

Description

index_name

Index table name. It consists of letters, digits, and special characters (_).

db_name

Database name. If this parameter is not specified, the current default database is selected.

table_name

Name of the table to be deleted.

Precautions

IF EXISTS and db_name are optional.

Example

DROP INDEX if exists productNameIndexTable ON productdb.productSalesTable;

Response

The secondary index table is deleted, and the index information is deleted from the CarbonData table. The deletion success message is recorded in the system log.