资 源 简 介
check-unused-keys is a Perl script to identify unused indexes (and tables), based on the INFORMATION_SCHEMA.INDEX_STATISTICS Percona patch. With the --create-alter option, it will create full ALTER TABLE statements to drop the unused indexes.
Usage
```
%> ./checkunusedkeys --help
Usage:
check-unused-keys [OPTIONS]
Options:
-d, --databases= Comma-separated list of databases to check
-h, --help Display this message and exit
-H, --hostname= The target MySQL server host
--[no]create-alter Print ALTER statements for each table
--ignore-databases Comma-separated list of databases to ignore
--ignore-indexes Comma-separated list of indexes to ignore
db_name.tbl_name.index_name
--ignore-tables Comma-separated list of tables to ignore
db_name.tbl_name
--[no]ignore-primary W