Merge pull request #60 from eljrax/master
Fixed reporting for temporary tables created on disk. Created_tmp_disk_t...
This commit is contained in:
		
						commit
						93691e1650
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		|  | @ -701,7 +701,7 @@ sub calculations { | |||
| 	# Temporary tables | ||||
| 	if ($mystat{'Created_tmp_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 { | ||||
| 			$mycalc{'pct_temp_disk'} = 0; | ||||
| 		} | ||||
|  | @ -906,17 +906,17 @@ sub mysql_stats { | |||
| 	# Temporary tables | ||||
| 	if ($mystat{'Created_tmp_tables'} > 0) { | ||||
| 		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,"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,"Reduce your SELECT DISTINCT queries without LIMIT clauses"); | ||||
| 		} 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,"Reduce your SELECT DISTINCT queries without LIMIT clauses"); | ||||
| 		} 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 { | ||||
| 		# For the sake of space, we will be quiet here | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Major Hayden
						Major Hayden