LeiRui commented on a change in pull request #262: [IOTDB-144]meta data cache 
for query
URL: https://github.com/apache/incubator-iotdb/pull/262#discussion_r305601378
 
 

 ##########
 File path: 
iotdb/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
 ##########
 @@ -458,6 +470,24 @@ public QueryDataSource query(String deviceId, String 
measurementId, QueryContext
     }
   }
 
+  /**
+   * returns the top k% measurements which are most frequently used in queries.
 
 Review comment:
   I don't think the current method behaves as this annotation reads.
   The current `lruForSensorUsedInQuery` is `LinkedHashSet`, which only records 
the access order of sensors used by query. 
   Even some kind of LruLinkedHashSet is used, it can only return the first 
`num` oldeset sensors kept in the LRU, not the most frequently used ones.
   
   For example, I query d0.s0, d0.s1, d1.s2, d0.s3, d1.s1, d2.s1, d3.s1, d4.s2. 
The sensor are s0,s1,s2,s3,s1,s1,s1,s2. Suppose `num`=3
   1) `LinkedHashSet`
   returns s0,s1,s2
   2) some kind of LruLinkedHashSet. Suppose memory is big enough.
   returns s0,s3,s1. The top 3 of most recently used measurements.
   
   But the top 3 of most frequently used measurements should be s1,s2,s3/s0.
   
   Maybe you should think twice about the design, `most frequently used 
measurements` or `most recently used measurements`? Or as I comment in the next 
review, `most recently used device`?
   
   **most frequenly used / most recently used  + measurements / devices / 
device.measurement** 
   So we have 6 possible plans:
   1. most frequenly used measurements
   2. most recently used measurements
   3. most frequenly used devices
   4. most recently used devices
   5. most frequenly used device.measurement
   6. most recently used device.measurement
   

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to