Drop Index (dropIndexStatement)
Syntax
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
dropIndexStatement_start((START))
dropIndexStatement_start --> dropIndexStatement_0_0[DROP]:::quoted
dropIndexStatement_0_0 --> dropIndexStatement_0_1[INDEX]:::quoted
dropIndexStatement_0_1 --> dropIndexStatement_0_2[IF EXISTS]:::quoted
dropIndexStatement_0_1 --> dropIndexStatement_0_3[identifier]
dropIndexStatement_0_2 --> dropIndexStatement_0_3
dropIndexStatement_0_3 --> dropIndexStatement_0_4[ON]:::quoted
dropIndexStatement_0_4 --> dropIndexStatement_0_5[tableSpec]
dropIndexStatement_0_5 --> dropIndexStatement_end((END))
Purpose
The drop index statement drops an index of a table, as created by create index. The name of an index is unique per table, so the table is always named. An error is raised when the table has no index of that name. With if exists, the statement then affects no row.
Dropping a unique index allows rows with the same values in its columns again. The statement is available for the platforms of create index. Available from release 28.0 and the beta release 27.1 before it.
Examples
The following example drops the index orders_n1 of the table orders in the in-memory storage:
drop index if exists orders_n1 on orders@inmemorystorage