为懒人提供无限可能,生命不息,code不止
作者: whooyun发表于: 2025-02-22 11:39
idx_two_code
is
a
left
-prefix
of
idx_two_code_level
Key
definitions:
KEY
idx_two_code (two_code) USING BTREE,
idx_two_code_level (two_code,
level
) USING BTREE,
Column
types:
two_code
varchar
(30)
character
set
utf8mb4
collate
utf8mb4_0900_ai_ci
default
null
comment
'二字码'
int
not
'0'
'等级,0: 国家,1:省份,2:城市'
To
remove this duplicate
index
,
execute
:
ALTER
TABLE
test.ex_area
DROP
INDEX
idx_two_code;
## 直接从索引就能获得想要的数据,我们就可以称这个索引是覆盖索引, 覆盖索引直接从索引中就能获取数据,不需要回表,减少了磁盘io次数