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 <[EMAIL PROTECTED]> 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/[EMAIL PROTECTED] > > -- Eric Bergen [EMAIL PROTECTED] http://www.bleated.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]