CREATE INDEX
Complete reference for CREATE INDEX in MariaDB. Complete syntax guide with all options, clauses, and practical examples with comprehensive examples and best.
Syntax
CREATE [OR REPLACE] [UNIQUE|FULLTEXT|SPATIAL|VECTOR] INDEX
[IF NOT EXISTS] index_name
[index_type]
ON tbl_name (index_col_name,...)
[WAIT n | NOWAIT]
[index_option]
[algorithm_option | lock_option] ...
index_col_name:
col_name [(length)] [ASC | DESC]
index_type:
USING {BTREE | HASH | RTREE}
index_option:
[ KEY_BLOCK_SIZE [=] value
| index_type
| WITH PARSER parser_name
| COMMENT 'string'
| CLUSTERING={YES| NO} ]
[ IGNORED | NOT IGNORED ]
| DISTANCE={EUCLIDEAN| COSINE} ]
| M=number ]
algorithm_option:
ALGORITHM [=] {DEFAULT|INPLACE|COPY|NOCOPY|INSTANT}
lock_option:
LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}Description
Privileges
Online DDL
CREATE OR REPLACE INDEX
CREATE INDEX IF NOT EXISTS
Index Definitions
WAIT/NOWAIT
ALGORITHM
LOCK
Progress Reporting
WITHOUT OVERLAPS
Examples
See Also
Last updated
Was this helpful?

