From: Eric Bergen Date: December 7 2004 5:29pm Subject: Re: Query Cache List-Archive: http://lists.mysql.com/mysql/177002 Message-Id: <11b1bd99041207092946edbdfe@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 'show' is a query just like any select. They both return the same type of result set. As a result they can be issued from the C API or any other. http://dev.mysql.com/doc/mysql/en/SHOW_VARIABLES.html On Tue, 7 Dec 2004 17:12:28 +0000, Alexis Cheshire wrote: > > Do you know if this is available thru the C API .. Could a User Defined Function be written to return this? > > Any more ideas would be great.. > > Thanks > > Skex > > > -----Original Message----- > From: Eric Bergen [mailto:eric.bergen@stripped] > Sent: 07 December 2004 16:50 > To: Alexis Cheshire > Cc: mysql@stripped > Subject: Re: Query Cache > > 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 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=eric.bergen@stripped > > > > > > -- > Eric Bergen > eric.bergen@stripped > http://www.bleated.com > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql?unsub=alexis@stripped > > -- Eric Bergen eric.bergen@stripped http://www.bleated.com