Fixed reporting for temporary tables created on disk. Created_tmp_disk_tables is a subset of Created_tmp_tables
This commit is contained in:
parent
633b596dab
commit
604900d536
1 changed files with 4 additions and 4 deletions
|
@ -701,7 +701,7 @@ sub calculations {
|
||||||
# Temporary tables
|
# Temporary tables
|
||||||
if ($mystat{'Created_tmp_tables'} > 0) {
|
if ($mystat{'Created_tmp_tables'} > 0) {
|
||||||
if ($mystat{'Created_tmp_disk_tables'} > 0) {
|
if ($mystat{'Created_tmp_disk_tables'} > 0) {
|
||||||
$mycalc{'pct_temp_disk'} = int(($mystat{'Created_tmp_disk_tables'} / ($mystat{'Created_tmp_tables'} + $mystat{'Created_tmp_disk_tables'})) * 100);
|
$mycalc{'pct_temp_disk'} = int(($mystat{'Created_tmp_disk_tables'} / $mystat{'Created_tmp_tables'}) * 100);
|
||||||
} else {
|
} else {
|
||||||
$mycalc{'pct_temp_disk'} = 0;
|
$mycalc{'pct_temp_disk'} = 0;
|
||||||
}
|
}
|
||||||
|
@ -906,17 +906,17 @@ sub mysql_stats {
|
||||||
# Temporary tables
|
# Temporary tables
|
||||||
if ($mystat{'Created_tmp_tables'} > 0) {
|
if ($mystat{'Created_tmp_tables'} > 0) {
|
||||||
if ($mycalc{'pct_temp_disk'} > 25 && $mycalc{'max_tmp_table_size'} < 256*1024*1024) {
|
if ($mycalc{'pct_temp_disk'} > 25 && $mycalc{'max_tmp_table_size'} < 256*1024*1024) {
|
||||||
badprint "Temporary tables created on disk: $mycalc{'pct_temp_disk'}% (".hr_num($mystat{'Created_tmp_disk_tables'})." on disk / ".hr_num($mystat{'Created_tmp_disk_tables'} + $mystat{'Created_tmp_tables'})." total)\n";
|
badprint "Temporary tables created on disk: $mycalc{'pct_temp_disk'}% (".hr_num($mystat{'Created_tmp_disk_tables'})." on disk / ".hr_num($mystat{'Created_tmp_tables'})." total)\n";
|
||||||
push(@adjvars,"tmp_table_size (> ".hr_bytes_rnd($myvar{'tmp_table_size'}).")");
|
push(@adjvars,"tmp_table_size (> ".hr_bytes_rnd($myvar{'tmp_table_size'}).")");
|
||||||
push(@adjvars,"max_heap_table_size (> ".hr_bytes_rnd($myvar{'max_heap_table_size'}).")");
|
push(@adjvars,"max_heap_table_size (> ".hr_bytes_rnd($myvar{'max_heap_table_size'}).")");
|
||||||
push(@generalrec,"When making adjustments, make tmp_table_size/max_heap_table_size equal");
|
push(@generalrec,"When making adjustments, make tmp_table_size/max_heap_table_size equal");
|
||||||
push(@generalrec,"Reduce your SELECT DISTINCT queries without LIMIT clauses");
|
push(@generalrec,"Reduce your SELECT DISTINCT queries without LIMIT clauses");
|
||||||
} elsif ($mycalc{'pct_temp_disk'} > 25 && $mycalc{'max_tmp_table_size'} >= 256) {
|
} elsif ($mycalc{'pct_temp_disk'} > 25 && $mycalc{'max_tmp_table_size'} >= 256) {
|
||||||
badprint "Temporary tables created on disk: $mycalc{'pct_temp_disk'}% (".hr_num($mystat{'Created_tmp_disk_tables'})." on disk / ".hr_num($mystat{'Created_tmp_disk_tables'} + $mystat{'Created_tmp_tables'})." total)\n";
|
badprint "Temporary tables created on disk: $mycalc{'pct_temp_disk'}% (".hr_num($mystat{'Created_tmp_disk_tables'})." on disk / ".hr_num($mystat{'Created_tmp_tables'})." total)\n";
|
||||||
push(@generalrec,"Temporary table size is already large - reduce result set size");
|
push(@generalrec,"Temporary table size is already large - reduce result set size");
|
||||||
push(@generalrec,"Reduce your SELECT DISTINCT queries without LIMIT clauses");
|
push(@generalrec,"Reduce your SELECT DISTINCT queries without LIMIT clauses");
|
||||||
} else {
|
} else {
|
||||||
goodprint "Temporary tables created on disk: $mycalc{'pct_temp_disk'}% (".hr_num($mystat{'Created_tmp_disk_tables'})." on disk / ".hr_num($mystat{'Created_tmp_disk_tables'} + $mystat{'Created_tmp_tables'})." total)\n";
|
goodprint "Temporary tables created on disk: $mycalc{'pct_temp_disk'}% (".hr_num($mystat{'Created_tmp_disk_tables'})." on disk / ".hr_num($mystat{'Created_tmp_tables'})." total)\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
# For the sake of space, we will be quiet here
|
# For the sake of space, we will be quiet here
|
||||||
|
|
Loading…
Reference in a new issue