xinghuayu007 opened a new issue #5792:
URL: https://github.com/apache/incubator-doris/issues/5792


   ### Cache Implement
   
   Look at pic 1. Doris supports two kinds of cache: sql cache and partition 
cache. The cache structure is `sql key -> {<partition key, cache data>, 
<partition key, cache data>, <partition key, cache data>}`. One sql has one 
cache node, one cache node has many partition cache point. But for sql cache, 
it has only one partition cache point, partition key is the latest partition 
id. When fetch cache data, it will compare partition key and partition version, 
partition update time to make sure the cache data available.
   
   ![Cache   ProcessOn免费在线作图,在线流程图,在线思维导图   
(1)](https://user-images.githubusercontent.com/12771191/117782509-47791480-b274-11eb-983c-09406835182a.png)
   
   ### The Problem
   When a table has four partitons [p202103, p202104, p202105, p202106]. 
   1. partition p202103 is loaded data into it, it is the latest partition. 
   2. `select * from table` will take the partition id of p202103 as the 
request param to fetche cache.  
   3. sql cache will be planted, like <sql_key, {<p202103, cache data>}
   4.  partition p202104 is loaded data into it, it is the latest partition. 
   5. execute sql query `select * from table`, it will take the partition id of 
p202104 as the request param to fetche cache
   6.  sql cache will be planted, like <sql_key, {<p202103, cache data>, 
<p202104, cache data>}
   
   Therefore, in this situation, one sql key will exist many version cache, the 
old version can not be replaced by new cache. We expected one sql key has only 
one version cache in case of memory waste.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to