Summary
The CREATE INDEX statement in MySQL 8.0 and 5.7 allows users to add indexes to existing tables.
1
2
It supports prefix lengths for CHAR, VARCHAR, BINARY, and VARBINARY key parts
1
2
, and can be used to create multi-valued indexes on JSON columns.
1
Additionally, the CREATE INDEX statement can be used to create a primary key for a table
1
, and the index_part_length and index_values options can be used to specify the index prefix length.
2
According to
Summary
The CREATE INDEX statement in MySQL 8.0 allows users to add indexes to existing tables. It can be used to create multi-valued indexes on JSON columns, and can be used to specify prefix lengths for string, VARCHAR, BINARY, and VARBINARY key parts. Additionally, the CREATE INDEX statement can be used to create a primary key for a table, and the index can be used to create a multi-valued index on a JSON column.
MySQL :: MySQL 8.0 Reference Manual :: 13.1.15 CREATE INDEX Statement
mysql.com
| ADD SPATIAL [INDEX|KEY] [index_name] (index_col_name,...) [index_option] ... | ADD [CONSTRAINT [symbol]] FOREIGN KEY [IF NOT EXISTS] [index_name] ...
ALTER TABLE - MariaDB Knowledge Base
mariadb.com
Summary
The CREATE INDEX statement in MySQL 5.7 allows users to add indexes to existing tables. It supports prefix lengths for CHAR, VARCHAR, BINARY, and VARBINARY key parts, and can be used to create multiple-column indexes. The index can be used to store index values in ascending order, and the index_part_length and index_values options can be used to specify the index prefix length.
MySQL :: MySQL 5.7 Reference Manual :: 13.1.14 CREATE INDEX Statement
mysql.com
Hello everyone, i`m not really new to Mysql but I´m having trouble with a ALTER TABLE statement. All I want to do is to add an index to an existing Table. The ...
MySQL :: ADD INDEX to Table if not exists
mysql.com
Create an index on one or more columns. ... CREATE INDEX is mapped to an ALTER TABLE statement to create indexes . See ALTER TABLE . CREATE INDEX cannot be ...
CREATE INDEX - MariaDB Knowledge Base
mariadb.com