Forked from sorohan/check-mysql-disabled-keys.sh
Last active
December 5, 2017 09:12
-
-
Save FreeSS/1f30797ae36a87d44bb2dc4ba41dd11b to your computer and use it in GitHub Desktop.
Revisions
-
FreeSS revised this gist
Dec 5, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ # Check all databases/tables in mysql for disabled keys. # MYSQL="mysql -uUSER -pPASS" dbs=$(echo "show databases" | $MYSQL -N) for db in $dbs; do -
FreeSS revised this gist
Dec 5, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ dbs=$(echo "show databases" | $MYSQL -N) for db in $dbs; do tables=$(echo "show tables" | $MYSQL -N $db) for tb in $tables; do indexes=$(echo "show indexes from $db.$tb" | $MYSQL -N | grep disabled | awk '{print $3}') for i in $indexes; do echo "disabled index: $db.$tb.$i" done -
sorohan created this gist
Jul 15, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ #!/bin/bash # # Check all databases/tables in mysql for disabled keys. # MYSQL="mysql" dbs=$(echo "show databases" | $MYSQL -N) for db in $dbs; do tables=$(echo "show tables" | $MYSQL -N $db) for tb in $tables; do indexes=$(echo "show indexes from $db.$tb" | mysql -N | grep disabled | awk '{print $3}') for i in $indexes; do echo "disabled index: $db.$tb.$i" done done done