MySQL index maintenance and optimization--find duplicate and redundant indexes

Source: Internet
Author: User
Tags mysql index

Method One: Find duplicate and redundant indexes through MySQL's INFORMATION_SCHEMA database

SELECTA.table_schema as 'Database', A.table_name as 'Table name', A.index_name as 'Index 1', B.index_name as 'Index 2', A.column_name as 'repeating column names' fromInformation_schema.StatisticsaJOIN StatisticsB onA.table_schema=B.table_schema andA.table_name=B.table_name andA.seq_in_index=B.seq_in_index andA.column_name=B.column_nameWHEREA.seq_in_index= 1     andA.index_name!=B.index_name

Method Two: Through tools

Use the PT-Duplicate-key-checker tool to check for duplicate and redundant index usage pt-Duplicate  -key----pxxx

Finding duplicate and redundant indexes

Reference to MU-class network: http://www.imooc.com/video/3998

MySQL index maintenance and optimization--find duplicate and redundant indexes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.