From 62e42e3c2550fecb804287a0b0674a3a049423dd Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Thu, 28 May 2009 00:40:43 +0000 Subject: [PATCH] When counting index size for MyISAM tables, the INFORMATION_SCHEMA query included all engines. (Thanks to Tom Krouper) --- mysqltuner.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 11bf74b..4f15de2 100644 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -31,6 +31,7 @@ # Ryan Novosielski Michael Scheidell # Blair Christensen Hans du Plooy # Victor Trac Everett Barnes +# Tom Krouper # # Inspired by Matthew Montgomery's tuning-primer.sh script: # http://forge.mysql.com/projects/view.php?id=44 @@ -545,7 +546,7 @@ sub calculations { if ($doremote eq 0 and $mysqlvermajor < 5) { $mycalc{'total_myisam_indexes'} = `find $myvar{'datadir'} -name '*.MYI' 2>&1 | xargs du -L $duflags '{}' 2>&1 | awk '{ s += \$1 } END { printf (\"%d\",s) }'`; } elsif ($mysqlvermajor >= 5) { - $mycalc{'total_myisam_indexes'} = `mysql $mysqllogin -Bse "SELECT IFNULL(SUM(INDEX_LENGTH),0) FROM information_schema.TABLES WHERE TABLE_SCHEMA NOT IN ('information_schema');"`; + $mycalc{'total_myisam_indexes'} = `mysql $mysqllogin -Bse "SELECT IFNULL(SUM(INDEX_LENGTH),0) FROM information_schema.TABLES WHERE TABLE_SCHEMA NOT IN ('information_schema') AND ENGINE = 'MyISAM';"`; } if (defined $mycalc{'total_myisam_indexes'} and $mycalc{'total_myisam_indexes'} =~ /^0\n$/) { $mycalc{'total_myisam_indexes'} = "fail";