MySQLidxchk: http://hackMySQL.com 檢查MySQL數據庫中未使用的index。簡單用法: mysqlidxchk -D databaseA -s /var/log/mysql/MySQL_slow.log -g --general LOG 如果開啟了general log的話可以用這個。 --slow LOG 指定慢log --raw LOG 應該就是 由 “;” 分開的一些sql語句 --user USER Connect to MySQL as USER --passWord PASS Use PASS or prompt for MySQL user's passWord --host ADDRESS Connect to MySQL at ADDRESS --port PORT Connect to MySQL at PORT --socket SOCKET Connect to MySQL at SOCKET --no-mycnf Don't read ~/.my.cnf --help Prints this --debug Print debugging information --general LOG(-g) Read querIEs from general LOG | Multiple logs can be --slow LOG (-s) Read querIEs from slow LOG | can be given like --raw LOG (-r) Read querIEs from LOG | file1,file2,file3,... --discovery-report Print database discovery report --grep P grep for statements that match Perl regex pattern P --ignore-update Ignore UPDATE statements --no-discovery Do not attempt database discovery --show-all-databases Show all databases --show-only-databases D Show only databases D (comma-separated list) --show-used-indexes Show used indexes