[Overview] Problem Overview In MySQL, there are some system tables or views that can query redundant indexes, duplicate indexes, and unused indexes, and then perform index optimization. What methods are available in TiDB to check for redundant indexes, duplicate indexes, and unused indexes?
[TiDB Version]
Release Version: v5.0.1
Edition: Community
Git Commit Hash: 1145e347d3469d8e89f88dce86f6926ca44b3cd8
Git Branch: heads/refs/tags/v5.0.1
UTC Build Time: 2021-04-23 05:51:17
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
If the question is related to performance optimization or troubleshooting, please download the script and run it. Please select all and copy-paste the terminal output.
The mysql.schema_index_usage table, refer to the following link:
Additionally, you can also perform aggregate analysis on the information_schema.statements_summary table. The indexes used by SQL are in the INDEX_NAMES field, and the number of times SQL is executed is in the EXEC_COUNT field.
The statistical function of the mysql.schema_index_usage table has not been implemented yet, right? There is no data in TiDB v5.0.1. Some information can still be aggregated in the information_schema.statements_summary table. Thank you very much.