关于冗余索引问题
select a.table_schema as '数据名', a.table_name as '表名', a.index_name as '索引1', b.index_name as '索引2', a.column_name as '重复列名' from statistics a join statistics b on a.table_schema = b.table_schema and a.table_name = b.table_name and a.seq_in_index = b.seq_in_index and a.column_name = b.column_name where a.seq_in_index = 1 and a.index_name <> b.index_name
该语句能够查询出重复使用的索引列,那么某一列多次出现在多个字段联合索引中时,这样的索引算冗余吗?比如表中含有a、b、c三个字段,对a、b建立索引,对a、c建立索引,那么算冗余吗?如果算,如何优化呢?