Is query_cache_size = 0 still required to turn off the query cache for good?

The venerable blog post about performance tuning after installation suggests setting query_cache_size = 0 in addition to query_cache_type = 0, reasoning that the query cache is not really disabled if query_cache_size is not 0. I discussed this with a hosting provider while tuning the performance of a application. They set query_cache_type = 0 but left query_cache_size at a non 0 value, arguing that the value of query_cache_size doesn’t matter if query_cache_type is 0. I’m wondering if the tip about query_cache_size is still valid or if maybe the loophole has been closed in the code. The blog post also says that no benchmarks have been done on this topic. Maybe it was never an issue?

Hi Apapsch, In the latest version on MySQL 5.7 the query cache settings are actually deprecated and by default the query_cache_type is set to 0 (disabled). In this case it does not really matter that much if the query_cache_size is set to 1M (default) or 0. https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_query_cache_size So in the latest version of 5.7 you can not even set it at all (as it is default set to 0). Let me know if you will have any other questions.

Alex