Skip to content

Commit

Permalink
Merge pull request #698 from jmrenouard/master
Browse files Browse the repository at this point in the history
Please add option to disable "Table structures analysis" #695
  • Loading branch information
jmrenouard authored Jul 6, 2023
2 parents 17eed4f + 3692e02 commit db21ef4
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions mysqltuner.pl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
# mysqltuner.pl - Version 2.2.3
# mysqltuner.pl - Version 2.2.4
# High Performance MySQL Tuning Script
# Copyright (C) 2006-2023 Major Hayden - [email protected]
# Copyright (C) 2015-2023 Jean-Marie Renouard - [email protected]
Expand Down Expand Up @@ -57,7 +57,7 @@ package main;
#use Env;

# Set up a few variables for use in the script
my $tunerversion = "2.2.3";
my $tunerversion = "2.2.4";
my ( @adjvars, @generalrec );

# Set defaults
Expand Down Expand Up @@ -96,6 +96,8 @@ package main;
"nocolstat" => 0,
"idxstat" => 0,
"noidxstat" => 0,
"nomyisamstat" => 0,
"nostructstat" => 0,
"sysstat" => 0,
"nosysstat" => 0,
"pfstat" => 0,
Expand Down Expand Up @@ -144,6 +146,8 @@ package main;
'sysstat', 'nosysstat',
'pfstat', 'nopfstat',
'idxstat', 'noidxstat',
'structstat', 'nostructstat',
'myisamstat', 'nomyisamstat',
'server-log=s', 'protocol=s',
'defaults-extra-file=s', 'dumpdir=s',
'feature=s', 'dbgpattern=s',
Expand Down Expand Up @@ -214,6 +218,9 @@ package main;
$opt{sysstat} = 1; # Print index information
$opt{buffers} = 1; # Print global and per-thread buffer values
$opt{pfstat} = 1; # Print performance schema info.
$opt{structstat} = 1; # Print table structure information
$opt{myisamstat} = 1; # Print MyISAM table information

$opt{cvefile} = 'vulnerabilities.csv'; #CVE File for vulnerability checks
}
$opt{nocolor} = 1 if defined( $opt{outputfile} );
Expand All @@ -226,6 +233,8 @@ package main;
$opt{pfstat} = 0
if ( $opt{nopfstat} == 1 ); # Don't print performance schema information
$opt{idxstat} = 0 if ( $opt{noidxstat} == 1 ); # Don't print index information
$opt{structstat} = 0 if ( $opt{nostructstat} == 1 ); # Don't print table struct information
$opt{myisamstat} = 0 if ( $opt{nomyisamstat} == 1 ); # Don't print MyISAM table information

# for RPM distributions
$opt{cvefile} = "/usr/share/mysqltuner/vulnerabilities.csv"
Expand Down Expand Up @@ -3815,6 +3824,7 @@ sub mysql_stats {

# Recommendations for MyISAM
sub mysql_myisam {
return 0 unless $opt{'myisamstat'} == 1;
subheaderprint "MyISAM Metrics";
my $nb_myisam_tables = select_one(
"SELECT COUNT(*) FROM information_schema.TABLES WHERE ENGINE='MyISAM' and TABLE_SCHEMA NOT IN ('mysql','information_schema','performance_schema')");
Expand Down Expand Up @@ -5750,6 +5760,7 @@ sub get_wsrep_option {
# REcommendations for Tables
sub mysql_table_structures {
return 0 unless $opt{structstat}==1;
subheaderprint "Table structures analysis";
my @primaryKeysNbTables = select_array(
Expand Down Expand Up @@ -7264,7 +7275,7 @@ sub which {
=head1 NAME
MySQLTuner 2.2.3 - MySQL High Performance Tuning Script
MySQLTuner 2.2.4 - MySQL High Performance Tuning Script
=head1 IMPORTANT USAGE GUIDELINES
Expand Down

0 comments on commit db21ef4

Please sign in to comment.