Bug #23714 QUERY CACHE INFORMATION
Submitted: 27 Oct 2006 12:31 Modified: 7 Jul 2017 9:13
Reporter: Roberto Spadim (Basic Quality Contributor) Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Query Cache Severity:S4 (Feature request)
Version:any OS:Any (any)
Assigned to: Geir Høydalsvik CPU Architecture:Any
Tags: qc, query cache

[27 Oct 2006 12:31] Roberto Spadim
Description:
Hello today we have Qcache_non_cached and Qcache_queries_in_cache, about queries in cache we don't know what queries are in cache, and about non cached we don't know why they aren't cached, could we have any think like

SHOW QUERIES IN CACHE

and maybe an log about queries that aren't cached? or new status variables like

Qcache_non_cached_too_small_query
Qcache_non_cached_too_large_query

with it we could know how change query_cache_min_res_unit and query_cache_limit variables

How to repeat:
show status like 'Qcache_non_cached_%'
show queries in cache

Suggested fix:
new status variables
new log files
[27 Oct 2006 13:19] Valeriy Kravchuk
Thank you for a reasonable feature request. Some way to look at query cache content is surely needed.
[27 Oct 2006 13:25] Roberto Spadim
Any idea when it will be added?
show queries in cache could be:

id?   query_string    mem_size     create_datetime    hits
[26 Nov 2006 12:49] Valeriy Kravchuk
Bug #24467 was marked as a duplicate of this one.
[27 Nov 2006 3:22] Roberto Spadim
what about see queries that was not cache because low size or very big size?
with this we could set query cache variables better to fit our queries that aren't beeing cached
[21 Mar 2011 3:28] Roberto Spadim
hi guys, 5 years ago when i was at university... hehehehe
=)

i was thinking about query cache yesterday and remembered this post...

any idea?

obs: show queries in cache, MUST lock query cache (no dirty reads)

non cached queries could be put in a log file, or just a variable counter (today implemented and working)
thanks
[24 Mar 2011 12:16] Kristofer Pettersson
Incidently this feature was developed by my 14 year old intern and then discarded because of lack of interest. I find that amusing.
[24 Mar 2011 14:25] Roberto Spadim
there's a patch to test?
[24 Mar 2011 15:14] Roberto Spadim
could you tell to 14 years guy that his code is very usefull! :P could he send it to me? i could test it without problems :) i don't know anything about internal mysql code
[5 Apr 2011 5:43] Roberto Spadim
news?
[14 Nov 2011 19:29] Roberto Spadim
news?
[10 Jan 2013 20:39] Mikhail Goryachkin
https://github.com/mcshadow/mysql_query_cache this plugin might be useful. Unfortunately its description available only in Russian on rus it resource :) but C++ is C++ and you can easily test it by yourself. Hope this helps.
[26 Sep 2014 19:30] Roberto Spadim
check this too
http://rspadim.blogspot.com.br/2014/09/more-about-query-cache.html
[7 Jul 2017 9:13] Erlend Dahl
MySQL will no longer invest in the query cache, see:

http://mysqlserverteam.com/mysql-8-0-retiring-support-for-the-query-cache/