List:General Discussion« Previous MessageNext Message »
From:Alexis Cheshire Date:December 7 2004 6:19pm
Subject:RE: Query Cache
View as plain text  
Sorry I think I asked the question in the wrong way... 
I know I can access the Variables you mentioned via "SHOW" queries, but was wondering if
there is any way by either:
1) Hacking the C Source Code 
OR
2) Writing a User Defined Function 

To determine if a particular query result has been returned from the Cache rather than the
Direct from Raw Tables.

Hope that is a bit clearer

Cheers

Skex

-----Original Message-----
From: Eric Bergen [mailto:eric.bergen@stripped] 
Sent: 07 December 2004 17:30
To: Alexis Cheshire
Cc: mysql@stripped
Subject: Re: Query Cache

'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 <alexis@stripped> 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 <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
> 
> --
> 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

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=1



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