Get the App
SLTechnology News&Howtos  ›  Database  › 

MySQL index

Shulou Source: shulou.com Published: 2022-06-01 04:10:26 10月01日 Update

MySQL creates and deletes indexes

Create a normal index:

Alter table student add index index_dept (dept (8))

Create a unique index

Create unique index uni_ind_name on student (name)

Create an index based on the first n characters of the column

Create index index_dept on student (dept (8))

Create a federated index based on multiple columns

Create index ind_name_dept on student (name,dept)

Create a federated index based on the first n characters of multiple columns

Create index ind_name_dept on student (name (8), dept (10))

Delete a normal index

Alter table student drop index index_dept

Drop index index_dept on student

Tags: Index normal multiple character Union Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi MariaDB Microsoft Shulou Technology Xiaomi