Tuesday, February 16, 2016

To disable MySQL query cache when testing

To disable MySQL query cache when testing:

SELECT SQL_NO_CACHE id, name FROM customer;

Or

RESET QUERY CACHE

Or

SET SESSION query_cache_type = OFF

Note: Besides the query cache, there is also the cache in buffer pool you need to consider. The only way to purge the buffer pool is to restart the MySQL instance.

Reference:

http://stackoverflow.com/questions/16043943/how-to-disable-mysql-query-caching

http://dev.mysql.com/doc/refman/5.7/en/innodb-buffer-pool.html

No comments: