List:General Discussion« Previous MessageNext Message »
From:Eric Bergen Date:December 7 2004 4:50pm
Subject:Re: Query Cache
View as plain text  
Skex, 

show status like 'Qcache%'; 
Will give you status of the query cache. There isn't a way to tell if
a query result
came from the cache or not other than the time it took to return or if
it's the only query ran
between checks of the show status.  Neither of these methods is very
reliable. Cache hits from Qcache_hits and Com_select from
show status like 'Com_select'; 
should be enough to tune the cache. Alternatly the mytop utility will
show you cache hit miss ratios on the fly.

-Eric


On Tue, 7 Dec 2004 16:28:38 +0000, Alexis Cheshire <alexis@stripped> wrote:
> Hi,
> 
> Is there a way to access if a Query is returning its record from QUERY_CACHE or not?
> 
> E.g.
> 
> $sql="SELECT * FROM TABLE";
> $result=db_query($sql);
> print $result;
> 
> //If query NoT returned from mysql_query_cache()
> //Would Output something like:
> Array["status"]["cached"]=0;
> Array["status"]["count"]=1;
> Array["data"][0][field1]=1;
> Array["data"][0][field2]=2;
> Etc...
> 
> //ELSE
> //Would Output something like:
> Array["status"]["cached"]=1;
> Array["status"]["count"]=1;
> Array["data"][0][field1]=1;
> Array["data"][0][field2]=2;
> Etc...
> 
> Any ideas would be greatly appreciated...
> 
> Skex
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
> 
> 


-- 
Eric Bergen
eric.bergen@stripped
http://www.bleated.com
Thread
Query CacheAlexis Cheshire7 Dec
  • Re: Query CacheEric Bergen7 Dec
RE: Query CacheAlexis Cheshire7 Dec
  • Re: Query CacheEric Bergen7 Dec
RE: Query CacheAlexis Cheshire7 Dec