From 3ac95cd046da81fc081bd762de46178cd75d6fee Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Wed, 27 Jan 2021 17:02:56 +1100 Subject: [PATCH] query_cache off with query_cache_type=OFF OR query_cache_size=0 From the MySQL and MariaDB code (same - 5.5 version): https://github.com/mysql/mysql-server/blob/5.5/sql/sql_cache.h#L560 https://github.com/MariaDB/server/blob/5.5/sql/sql_cache.h#L572 This is used: https://github.com/mysql/mysql-server/blob/5.5/sql/sql_prepare.cc#L3058 (same in MariaDB code) The size=0 and type=0 are both sufficent conditions for the query cache to be disabled. As such lets consider it ok if its disabled only in one place. This is the case in mariadb where type=0 (OFF) is the default as is a non-zero query-cache size. --- mysqltuner.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index dc36b62..edff935 100644 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -2994,7 +2994,7 @@ sub mysql_stats { #return; } elsif ( $myvar{'query_cache_size'} < 1 - and $myvar{'query_cache_type'} eq "OFF" ) + or $myvar{'query_cache_type'} eq "OFF" ) { goodprint "Query cache is disabled by default due to mutex contention on multiprocessor machines.";