Recently I build and install special plugin from this source http://rpbouman.blogspot.com/2008/07/inspect-query-cahce-usi ng-mysql.html#links
This seems to work fine (need some trivial code hacking for my 5.1.37 version, can share if anybody need it).
desc MYSQL_CACHED_QUERIES;±------------------------±------------±-----±----±--------±------+| Field | Type | Null | Key | Default | Extra |±------------------------±------------±-----±----±--------±------+| STATEMENT_ID | int(21) | NO | | 0 | || SCHEMA_NAME | varchar(64) | NO | | | || STATEMENT_TEXT | longtext | NO | | NULL | || RESULT_BLOCKS_COUNT | int(21) | NO | | 0 | || RESULT_BLOCKS_SIZE | bigint(21) | NO | | 0 | || RESULT_BLOCKS_SIZE_USED | bigint(21) | NO | | 0 | |±------------------------±------------±-----±----±--------±------+
but if mysql query cache really use LRU http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently _Used algorithm (there are many sources in internet with this opinion), there must be hits counter or age value or linked list order must be moving frequently .
But it doesn’t : you can select without order and see stable orded. you can produce query hit many times, but nothing changes.
I think mysql use “Least Recently Inserted” algorithm. Am I right?
So I have questions:
Does mysql really use LRU strategy for query cache ?
Is existing realization good enough for general use ?
Any other realization of query cache available in public ?