MySQL Query Cache – Type of Queue Used

cacheMySQLoptimizationquery-cache

I am wondering what type of queue is MySQL Query Cache using.
When there is new query and cache is full which query is deleted? Oldest one? One with fewer number of hits? Or maybe there is some different logic behind that?

I tried to find something in documentation, but without success.

Best Answer

According to the manual, the query cache removes the Least Recently Used (LRU) Query from the Query Cache when the Query Cache is full. Read the general chapter on the MySQL Query Cache for a more detailed description of the logic and architecture of the Query Cache.