Skip to content

Commit 71f5a41

Browse files
authored
Merge pull request #872 from jmrenouard/master
v2.8.24 2.8.24 2026-01-18 - fix: improve MariaDB 11+ detection by checking version_comment (issue #869) - fix: handle innodb_buffer_pool_chunk_size=0 (autosize) in MariaDB 10.8+ (#869) - chore: bump version to 2.8.24 2.8.23 2026-01-18 - feat: add --ignore-tables CLI option to filter specific tables from analysis (#749) - chore: bump version to 2.8.23
2 parents a8ede22 + 3e8a36c commit 71f5a41

6 files changed

Lines changed: 427 additions & 34 deletions

File tree

.github/FUNDING.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12+
polar: # Replace with a single Polar username
13+
buy_me_a_coffee: jmrenouard
14+
thanks_dev: # Replace with a single thanks.dev username
15+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

CURRENT_VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.8.23
1+
2.8.25

Changelog

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1-
2.8.23 2026-01-18
1+
2.8.25 2026-01-18
22

33
-
44

5+
2.8.24 2026-01-18
6+
7+
- fix: improve MariaDB 11+ detection by checking version_comment (issue #869)
8+
- fix: handle innodb_buffer_pool_chunk_size=0 (autosize) in MariaDB 10.8+ (#869)
9+
- chore: bump version to 2.8.24
10+
11+
2.8.23 2026-01-18
12+
13+
- feat: add --ignore-tables CLI option to filter specific tables from analysis (#749)
14+
- chore: bump version to 2.8.23
15+
516
2.8.22 2026-01-18
617

718
- feat: update all repository links from 'major' to 'jmrenouard' (issue #410)

mysqltuner.pl

Lines changed: 53 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env perl
2-
# mysqltuner.pl - Version 2.8.23
2+
# mysqltuner.pl - Version 2.8.25
33
# High Performance MySQL Tuning Script
44
# Copyright (C) 2015-2023 Jean-Marie Renouard - jmrenouard@gmail.com
55
# Copyright (C) 2006-2023 Major Hayden - major@mhtx.net
@@ -59,7 +59,7 @@ package main;
5959
my $is_win = $^O eq 'MSWin32';
6060

6161
# Set up a few variables for use in the script
62-
my $tunerversion = "2.8.23";
62+
my $tunerversion = "2.8.25";
6363
my ( @adjvars, @generalrec );
6464

6565
# Set defaults
@@ -132,7 +132,8 @@ package main;
132132
"ssh-password" => '',
133133
"ssh-identity-file" => '',
134134
"container" => '',
135-
"max-password-checks" => 100
135+
"max-password-checks" => 100,
136+
"ignore-tables" => ''
136137
);
137138

138139
# Gather the options from the command line
@@ -174,7 +175,8 @@ package main;
174175
'noprettyicon', 'cloud',
175176
'azure', 'ssh-host=s',
176177
'ssh-user=s', 'ssh-password=s',
177-
'ssh-identity-file=s', 'container=s', 'max-password-checks=i'
178+
'ssh-identity-file=s', 'container=s', 'max-password-checks=i',
179+
'ignore-tables=s'
178180
)
179181
or pod2usage(
180182
-exitval => 1,
@@ -2601,7 +2603,7 @@ sub security_recommendations {
26012603

26022604
# New table schema available since mysql-5.7 and mariadb-10.2
26032605
# But need to be checked
2604-
if ( $myvar{'version'} =~ /5\.7|10\.[2-5]\..*MariaDB*/ ) {
2606+
if ( ($myvar{'version'} =~ /5\.7/) or (($myvar{'version'} =~ /10\.[2-5]\..*/) and (($myvar{'version'} =~ /MariaDB/i) or ($myvar{'version_comment'} =~ /MariaDB/i)))) {
26052607
my $password_column_exists =
26062608
`$mysqlcmd $mysqllogin -Bse "SELECT 1 FROM information_schema.columns WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME = 'user' AND COLUMN_NAME = 'password'" 2>>$devnull`;
26072609
my $authstring_column_exists =
@@ -2918,7 +2920,7 @@ sub get_replication_status {
29182920
}
29192921

29202922
# Parallel replication checks (MariaDB specific)
2921-
if ( $myvar{'version'} =~ /MariaDB/i ) {
2923+
if ( ($myvar{'version'} =~ /MariaDB/i) or ($myvar{'version_comment'} =~ /MariaDB/i) ) {
29222924
my $parallel_threads = $myvar{'slave_parallel_threads'}
29232925
// $myvar{'replica_parallel_threads'} // 0;
29242926
if ( $parallel_threads > 1 ) {
@@ -7194,8 +7196,9 @@ sub mysql_innodb {
71947196
}
71957197

71967198
# InnoDB Used Buffer Pool Size vs CHUNK size
7197-
if ( $myvar{'version'} =~ /MariaDB/i
7199+
if ( ( ( $myvar{'version'} =~ /MariaDB/i ) or ( $myvar{'version_comment'} =~ /MariaDB/i ) )
71987200
and mysql_version_ge( 10, 8 )
7201+
and defined( $myvar{'innodb_buffer_pool_chunk_size'} )
71997202
and $myvar{'innodb_buffer_pool_chunk_size'} == 0 )
72007203
{
72017204
infoprint
@@ -7360,7 +7363,7 @@ sub mysql_innodb {
73607363
sub mariadb_query_cache_info {
73617364
subheaderprint "Query Cache Information";
73627365

7363-
unless ( $myvar{'version'} =~ /MariaDB/i ) {
7366+
unless ( ($myvar{'version'} =~ /MariaDB/i) or ($myvar{'version_comment'} =~ /MariaDB/i) ) {
73647367
infoprint
73657368
"Not a MariaDB server. Skipping Query Cache Info plugin check.";
73667369
return;
@@ -7452,42 +7455,48 @@ sub mysql_databases {
74527455
return;
74537456
}
74547457

7458+
my $ignore_tables_sql = "";
7459+
if ( $opt{'ignore-tables'} ne '' ) {
7460+
my @ignored = split /,/, $opt{'ignore-tables'};
7461+
$ignore_tables_sql = " AND TABLE_NAME NOT IN ('" . join( "','", @ignored ) . "')";
7462+
}
7463+
74557464
@dblist = select_array(
74567465
"SELECT SCHEMA_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME NOT IN ( 'mysql', 'performance_schema', 'information_schema', 'sys' );"
74577466
);
74587467
infoprint "There is " . scalar(@dblist) . " Database(s).";
74597468
my @totaldbinfo = split /\s/,
74607469
select_one(
7461-
"SELECT SUM(TABLE_ROWS), SUM(DATA_LENGTH), SUM(INDEX_LENGTH), SUM(DATA_LENGTH+INDEX_LENGTH), COUNT(TABLE_NAME), COUNT(DISTINCT(TABLE_COLLATION)), COUNT(DISTINCT(ENGINE)) FROM information_schema.TABLES WHERE TABLE_SCHEMA NOT IN ('mysql', 'performance_schema', 'information_schema', 'sys');"
7470+
"SELECT SUM(TABLE_ROWS), SUM(DATA_LENGTH), SUM(INDEX_LENGTH), SUM(DATA_LENGTH+INDEX_LENGTH), COUNT(TABLE_NAME), COUNT(DISTINCT(TABLE_COLLATION)), COUNT(DISTINCT(ENGINE)) FROM information_schema.TABLES WHERE TABLE_SCHEMA NOT IN ('mysql', 'performance_schema', 'information_schema', 'sys')$ignore_tables_sql;"
74627471
);
74637472
infoprint "All User Databases:";
74647473
infoprint " +-- TABLE : "
74657474
. select_one(
7466-
"SELECT count(*) from information_schema.TABLES WHERE TABLE_TYPE ='BASE TABLE' AND TABLE_SCHEMA NOT IN ('mysql', 'performance_schema', 'information_schema', 'sys')"
7475+
"SELECT count(*) from information_schema.TABLES WHERE TABLE_TYPE ='BASE TABLE' AND TABLE_SCHEMA NOT IN ('mysql', 'performance_schema', 'information_schema', 'sys')$ignore_tables_sql"
74677476
) . "";
74687477
infoprint " +-- VIEW : "
74697478
. select_one(
7470-
"SELECT count(*) from information_schema.TABLES WHERE TABLE_TYPE ='VIEW' AND TABLE_SCHEMA NOT IN ('mysql', 'performance_schema', 'information_schema', 'sys')"
7479+
"SELECT count(*) from information_schema.TABLES WHERE TABLE_TYPE ='VIEW' AND TABLE_SCHEMA NOT IN ('mysql', 'performance_schema', 'information_schema', 'sys')$ignore_tables_sql"
74717480
) . "";
74727481
infoprint " +-- INDEX : "
74737482
. select_one(
7474-
"SELECT count(distinct(concat(TABLE_NAME, TABLE_SCHEMA, INDEX_NAME))) from information_schema.STATISTICS WHERE TABLE_SCHEMA NOT IN ('mysql', 'performance_schema', 'information_schema', 'sys')"
7483+
"SELECT count(distinct(concat(TABLE_NAME, TABLE_SCHEMA, INDEX_NAME))) from information_schema.STATISTICS WHERE TABLE_SCHEMA NOT IN ('mysql', 'performance_schema', 'information_schema', 'sys')$ignore_tables_sql"
74757484
) . "";
74767485

74777486
infoprint " +-- CHARS : "
74787487
. ( $totaldbinfo[5] eq 'NULL' ? 0 : $totaldbinfo[5] ) . " ("
74797488
. (
74807489
join ", ",
74817490
select_array(
7482-
"select distinct(CHARACTER_SET_NAME) from information_schema.columns WHERE CHARACTER_SET_NAME IS NOT NULL AND TABLE_SCHEMA NOT IN ('mysql', 'performance_schema', 'information_schema', 'sys');"
7491+
"select distinct(CHARACTER_SET_NAME) from information_schema.columns WHERE CHARACTER_SET_NAME IS NOT NULL AND TABLE_SCHEMA NOT IN ('mysql', 'performance_schema', 'information_schema', 'sys')$ignore_tables_sql;"
74837492
)
74847493
) . ")";
74857494
infoprint " +-- COLLA : "
74867495
. ( $totaldbinfo[5] eq 'NULL' ? 0 : $totaldbinfo[5] ) . " ("
74877496
. (
74887497
join ", ",
74897498
select_array(
7490-
"SELECT DISTINCT(TABLE_COLLATION) FROM information_schema.TABLES WHERE TABLE_COLLATION IS NOT NULL AND TABLE_SCHEMA NOT IN ('mysql', 'performance_schema', 'information_schema', 'sys');"
7499+
"SELECT DISTINCT(TABLE_COLLATION) FROM information_schema.TABLES WHERE TABLE_COLLATION IS NOT NULL AND TABLE_SCHEMA NOT IN ('mysql', 'performance_schema', 'information_schema', 'sys')$ignore_tables_sql;"
74917500
)
74927501
) . ")";
74937502
infoprint " +-- ROWS : "
@@ -7504,7 +7513,7 @@ sub mysql_databases {
75047513
. (
75057514
join ", ",
75067515
select_array(
7507-
"SELECT DISTINCT(ENGINE) FROM information_schema.TABLES WHERE ENGINE IS NOT NULL AND TABLE_SCHEMA NOT IN ('mysql', 'performance_schema', 'information_schema', 'sys');"
7516+
"SELECT DISTINCT(ENGINE) FROM information_schema.TABLES WHERE ENGINE IS NOT NULL AND TABLE_SCHEMA NOT IN ('mysql', 'performance_schema', 'information_schema', 'sys')$ignore_tables_sql;"
75087517
)
75097518
) . ")";
75107519

@@ -7524,37 +7533,37 @@ sub mysql_databases {
75247533
foreach (@dblist) {
75257534
my @dbinfo = split /\s/,
75267535
select_one(
7527-
"SELECT TABLE_SCHEMA, SUM(TABLE_ROWS), SUM(DATA_LENGTH), SUM(INDEX_LENGTH), SUM(DATA_LENGTH+INDEX_LENGTH), COUNT(DISTINCT ENGINE), COUNT(TABLE_NAME), COUNT(DISTINCT(TABLE_COLLATION)), COUNT(DISTINCT(ENGINE)) FROM information_schema.TABLES WHERE TABLE_SCHEMA='$_' GROUP BY TABLE_SCHEMA ORDER BY TABLE_SCHEMA"
7536+
"SELECT TABLE_SCHEMA, SUM(TABLE_ROWS), SUM(DATA_LENGTH), SUM(INDEX_LENGTH), SUM(DATA_LENGTH+INDEX_LENGTH), COUNT(DISTINCT ENGINE), COUNT(TABLE_NAME), COUNT(DISTINCT(TABLE_COLLATION)), COUNT(DISTINCT(ENGINE)) FROM information_schema.TABLES WHERE TABLE_SCHEMA='$_'$ignore_tables_sql GROUP BY TABLE_SCHEMA ORDER BY TABLE_SCHEMA"
75287537
);
75297538
next unless defined $dbinfo[0];
75307539

75317540
infoprint "Database: " . $dbinfo[0] . "";
75327541
$nbTables = select_one(
7533-
"SELECT count(*) from information_schema.TABLES WHERE TABLE_TYPE ='BASE TABLE' AND TABLE_SCHEMA='$_'"
7542+
"SELECT count(*) from information_schema.TABLES WHERE TABLE_TYPE ='BASE TABLE' AND TABLE_SCHEMA='$_'$ignore_tables_sql"
75347543
);
75357544
infoprint " +-- TABLE : $nbTables";
75367545
infoprint " +-- VIEW : "
75377546
. select_one(
7538-
"SELECT count(*) from information_schema.TABLES WHERE TABLE_TYPE ='VIEW' AND TABLE_SCHEMA='$_'"
7547+
"SELECT count(*) from information_schema.TABLES WHERE TABLE_TYPE ='VIEW' AND TABLE_SCHEMA='$_'$ignore_tables_sql"
75397548
) . "";
75407549
infoprint " +-- INDEX : "
75417550
. select_one(
7542-
"SELECT count(distinct(concat(TABLE_NAME, TABLE_SCHEMA, INDEX_NAME))) from information_schema.STATISTICS WHERE TABLE_SCHEMA='$_'"
7551+
"SELECT count(distinct(concat(TABLE_NAME, TABLE_SCHEMA, INDEX_NAME))) from information_schema.STATISTICS WHERE TABLE_SCHEMA='$_'$ignore_tables_sql"
75437552
) . "";
75447553
infoprint " +-- CHARS : "
75457554
. ( $totaldbinfo[5] eq 'NULL' ? 0 : $totaldbinfo[5] ) . " ("
75467555
. (
75477556
join ", ",
75487557
select_array(
7549-
"select distinct(CHARACTER_SET_NAME) from information_schema.columns WHERE CHARACTER_SET_NAME IS NOT NULL AND TABLE_SCHEMA='$_';"
7558+
"select distinct(CHARACTER_SET_NAME) from information_schema.columns WHERE CHARACTER_SET_NAME IS NOT NULL AND TABLE_SCHEMA='$_'$ignore_tables_sql;"
75507559
)
75517560
) . ")";
75527561
infoprint " +-- COLLA : "
75537562
. ( $dbinfo[7] eq 'NULL' ? 0 : $dbinfo[7] ) . " ("
75547563
. (
75557564
join ", ",
75567565
select_array(
7557-
"SELECT DISTINCT(TABLE_COLLATION) FROM information_schema.TABLES WHERE TABLE_SCHEMA='$_' AND TABLE_COLLATION IS NOT NULL;"
7566+
"SELECT DISTINCT(TABLE_COLLATION) FROM information_schema.TABLES WHERE TABLE_SCHEMA='$_' AND TABLE_COLLATION IS NOT NULL$ignore_tables_sql;"
75587567
)
75597568
) . ")";
75607569
infoprint " +-- ROWS : "
@@ -7572,19 +7581,19 @@ sub mysql_databases {
75727581
. (
75737582
join ", ",
75747583
select_array(
7575-
"SELECT DISTINCT(ENGINE) FROM information_schema.TABLES WHERE TABLE_SCHEMA='$_' AND ENGINE IS NOT NULL"
7584+
"SELECT DISTINCT(ENGINE) FROM information_schema.TABLES WHERE TABLE_SCHEMA='$_' AND ENGINE IS NOT NULL$ignore_tables_sql"
75767585
)
75777586
) . ")";
75787587

75797588
foreach my $eng (
75807589
select_array(
7581-
"SELECT DISTINCT(ENGINE) FROM information_schema.TABLES WHERE TABLE_SCHEMA='$_' AND ENGINE IS NOT NULL"
7590+
"SELECT DISTINCT(ENGINE) FROM information_schema.TABLES WHERE TABLE_SCHEMA='$_' AND ENGINE IS NOT NULL$ignore_tables_sql"
75827591
)
75837592
)
75847593
{
75857594
infoprint " +-- ENGINE $eng : "
75867595
. select_one(
7587-
"SELECT COUNT(*) FROM information_schema.TABLES WHERE TABLE_SCHEMA='$dbinfo[0]' AND ENGINE='$eng'"
7596+
"SELECT COUNT(*) FROM information_schema.TABLES WHERE TABLE_SCHEMA='$dbinfo[0]' AND ENGINE='$eng'$ignore_tables_sql"
75887597
) . " TABLE(s)";
75897598
}
75907599

@@ -7698,12 +7707,18 @@ sub mysql_tables {
76987707

76997708
}
77007709

7710+
my $ignore_tables_sql = "";
7711+
if ( $opt{'ignore-tables'} ne '' ) {
7712+
my @ignored = split /,/, $opt{'ignore-tables'};
7713+
$ignore_tables_sql = " AND TABLE_NAME NOT IN ('" . join( "','", @ignored ) . "')";
7714+
}
7715+
77017716
foreach ( select_user_dbs() ) {
77027717
my $dbname = $_;
77037718
next unless defined $_;
77047719
infoprint "Database: " . $_ . "";
77057720
my @dbtable = select_array(
7706-
"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA='$dbname' AND TABLE_TYPE='BASE TABLE' ORDER BY TABLE_NAME"
7721+
"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA='$dbname' AND TABLE_TYPE='BASE TABLE'$ignore_tables_sql ORDER BY TABLE_NAME"
77077722
);
77087723
foreach (@dbtable) {
77097724
my $tbname = $_;
@@ -7805,7 +7820,13 @@ sub mysql_indexes {
78057820
#"Skip Index metrics from information schema due to erroneous information provided in this version";
78067821
# return;
78077822
# }
7808-
my $selIdxReq = <<'ENDSQL';
7823+
my $ignore_tables_sql = "";
7824+
if ( $opt{'ignore-tables'} ne '' ) {
7825+
my @ignored = split /,/, $opt{'ignore-tables'};
7826+
$ignore_tables_sql = " AND TABLE_NAME NOT IN ('" . join( "','", @ignored ) . "')";
7827+
}
7828+
7829+
my $selIdxReq = <<"ENDSQL";
78097830
SELECT
78107831
CONCAT(t.TABLE_SCHEMA, '.', t.TABLE_NAME) AS 'table',
78117832
CONCAT(s.INDEX_NAME, '(', s.COLUMN_NAME, ')') AS 'index'
@@ -7826,14 +7847,14 @@ sub mysql_indexes {
78267847
, INDEX_NAME
78277848
, MAX(SEQ_IN_INDEX) AS max_columns
78287849
FROM INFORMATION_SCHEMA.STATISTICS
7829-
WHERE TABLE_SCHEMA NOT IN ('mysql', 'information_schema', 'performance_schema')
7850+
WHERE TABLE_SCHEMA NOT IN ('mysql', 'information_schema', 'performance_schema')$ignore_tables_sql
78307851
AND INDEX_TYPE <> 'FULLTEXT'
78317852
GROUP BY TABLE_SCHEMA, TABLE_NAME, INDEX_NAME
78327853
) AS s2
78337854
ON s.TABLE_SCHEMA = s2.TABLE_SCHEMA
78347855
AND s.TABLE_NAME = s2.TABLE_NAME
78357856
AND s.INDEX_NAME = s2.INDEX_NAME
7836-
WHERE t.TABLE_SCHEMA NOT IN ('mysql', 'information_schema', 'performance_schema')
7857+
WHERE t.TABLE_SCHEMA NOT IN ('mysql', 'information_schema', 'performance_schema')$ignore_tables_sql
78377858
AND t.TABLE_ROWS > 10
78387859
AND s.CARDINALITY IS NOT NULL
78397860
AND (s.CARDINALITY / IFNULL(t.TABLE_ROWS, 0.01)) < 8.00
@@ -7876,7 +7897,7 @@ sub mysql_indexes {
78767897
INDEX_TYPE as type
78777898
FROM information_schema.statistics
78787899
WHERE INDEX_SCHEMA='$dbname'
7879-
AND index_name IS NOT NULL
7900+
AND index_name IS NOT NULL$ignore_tables_sql
78807901
GROUP BY table_name, idxname, type
78817902
ENDSQL
78827903
my $found = 0;
@@ -7902,13 +7923,13 @@ sub mysql_indexes {
79027923
unless ( defined( $myvar{'performance_schema'} )
79037924
and $myvar{'performance_schema'} eq 'ON' );
79047925

7905-
$selIdxReq = <<'ENDSQL';
7926+
$selIdxReq = <<"ENDSQL";
79067927
SELECT CONCAT(object_schema, '.', object_name) AS 'table', index_name
79077928
FROM performance_schema.table_io_waits_summary_by_index_usage
79087929
WHERE index_name IS NOT NULL
79097930
AND count_star = 0
79107931
AND index_name <> 'PRIMARY'
7911-
AND object_schema NOT IN ('mysql', 'performance_schema', 'information_schema')
7932+
AND object_schema NOT IN ('mysql', 'performance_schema', 'information_schema')$ignore_tables_sql
79127933
ORDER BY count_star, object_schema, object_name;
79137934
ENDSQL
79147935
@idxinfo = select_array($selIdxReq);
@@ -8340,7 +8361,7 @@ =head1 OUTPUT OPTIONS
83408361
83418362
=head1 VERSION
83428363
8343-
Version 2.8.23
8364+
Version 2.8.25
83448365
=head1 PERLDOC
83458366
83468367
You can find documentation for this module with the perldoc command.

0 commit comments

Comments
 (0)