Recently, when I was tuning MySQL, I felt that the query cache of MySQL was not as big as possible,
Because the cache actually fails when the data table changes as follows:
Including insert, update, delete, truncate, alter table, drop table, or drop database.
Therefore, if the table is read frequently, you can adjust the query cache. Otherwise, it will not work.
Attached adjustment parameters:
Query cache parameters:
Query_cache_size the space occupied by QC. Disable the QC function by setting it to 0.
Query_cache_type 0 indicates that QC is disabled; 1 indicates normal cache; 2 indicates that SQL _cache is cached.
Query_cache_limit Maximum Cache result set
In the query_cache_min_res_unit manual, QC allocates the cache Block Size Based on this value.
Qcache_lowmem_prunes is a state variable (show status). This value increases automatically when the cache space is insufficient and the old cache needs to be released.