MySQL 8.4 Release Notes
30.4.3.27 The schema_redundant_indexes 和 x$schema_flattened_keys 视图
schema_redundant_indexes 视图显示重复的索引或由其他索引所重复的索引。 x$schema_flattened_keys 视图是 schema_redundant_indexes 视图的辅助视图。
在以下列描述中,主索引是使重复索引变得不必要的索引。
schema_redundant_indexes 视图具有这些列:
-
table_schema包含表的架构。
-
table_name包含索引的表。
-
redundant_index_name重复索引的名称。
-
redundant_index_columns重复索引中的列名。
-
redundant_index_non_unique重复索引中的非唯一列数。
-
dominant_index_name主索引的名称。
-
dominant_index_columns主索引中的列名。
-
dominant_index_non_unique主索引中的非唯一列数。
-
subpart_exists索引是否只索引部分列。
-
sql_drop_index删除重复索引的语句。
x$schema_flattened_keys 视图具有这些列:
-
table_schema包含表的架构。
-
table_name包含索引的表。
-
index_name索引名称。
-
non_unique索引中的非唯一列数。
-
subpart_exists索引是否只索引部分列。
-
index_columns索引中的列名。