[Maria-developers] query cache issue
guys, i sent some (many) MDEV issues to have a better control over query cache i want to comment here to don't stay with this idea in my mind only... i created some labels in JIRA: querycache - relative to query cache qc_info - relative to qc_info plugin querycache_client - relative to implement query cache at client side (not in server) querycache_control - relative to DELETE queries in cache, DELETE tables in cache, LOCK/UNLOCK QUERY CACHE querycache_insert - relative to prune of queries that should be or shouldn't be cacheable querycache_lowmen - realtive to what we could do if we get low men in query cache querycache_result - features relative to when should or shouldn't hit query cache when query is cached if they will be or not implemented is another history is labels ok? should i remove it? -- Roberto Spadim
18.06.2013 04:16, Roberto Spadim пишет:
guys, i sent some (many) MDEV issues to have a better control over query cache i want to comment here to don't stay with this idea in my mind only... i created some labels in JIRA: [skip] querycache_client - relative to implement query cache at client side (not in server)
It is just interesting how QC can be connected to client side at all? [skip]
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)
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).
Nice, in this case, should be nice implement a cache server, and mysql servers will send cache to it? something like: 50000 mysql clients (no cache here) < - >10 mysql servers (100mb of cache each) < - >2 cache servers (16gb of cache each) we could use local cache + remote cache, for example, with this the local cache will be very fast, and the remote cache will have a network delay (but it's faster than disk i/o) what you think?
26.06.2013 18:08, Roberto Spadim пишет:
Nice, in this case, should be nice implement a cache server, and mysql servers will send cache to it? something like:
50000 mysql clients (no cache here) < - >10 mysql servers (100mb of cache each) < - >2 cache servers (16gb of cache each)
we could use local cache + remote cache, for example, with this the local cache will be very fast, and the remote cache will have a network delay (but it's faster than disk i/o)
what you think?
I think it is irrelevant to query cache.
participants (2)
-
Oleksandr Byelkin
-
Roberto Spadim