← Back to team overview

maria-developers team mailing list archive

Re: query cache issue

 

25.06.2013 16:58, Roberto Spadim пишет:
it's a memory in client side with query_parameters (sql_mode, query text,
schema used, and others flags that change results) + query_results
example in php
$query_cache= array(
"sql_mode=12341234124124;SELECT * from query_Table" => array(
   "tables_used"=>array("query_Table"),
   0=>array('a'=>1,'b'=>2,'c'=>3),
   2=>array('a'=>1,'b'=>2,'c'=>3),
   3=>array('a'=>1,'b'=>2,'c'=>3),
   4=>array('a'=>1,'b'=>2,'c'=>3),
   )
);
$query_tables_checksum=array("query_Table"=>'some_checksum');
the query_table_checksum is the part of query cache to invalidade a query
at client side, it must be checked at each query execution (this can be
done in less time or near time of a cached query)

before get from client side cache, query the server about table changes, if
the counter (or a checksum?)
if different, the query is invalid and must be removed from client side and
reexecuted, if not just get from query cache (in client side)
this add two news function at mysql protocol (one to get table
counters/checksums), and maybe must add a table counter that changes after
each update/delete/alter and save it (probably) at .FRM file, the other to
return the checksum at each query (with this we can see tables used in a
update for example and invalid the cache)

Query cache is certain feature of the server which is completely transparent for the client side (and should be). What you written above _COULD_ be other cache and so should be called with other name to avoid confusion.

Please do not create confusion and mess in JIRA.

P.S.: BTW sql_mode & Co are stored on server side and only that data does matter for the server response (JFYI).




Follow ups

References