Skip to content

Commit

Permalink
query_cache off with query_cache_type=OFF OR query_cache_size=0
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
grooverdan committed Jan 27, 2021
1 parent 9a9ff55 commit 3ac95cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mysqltuner.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
Expand Down

0 comments on commit 3ac95cd

Please sign in to comment.