mcvsubbu commented on a change in pull request #4363: When initializing mutable 
dictionary, preserve 20% buffer for cardinality to reduce the chance of 
re-sizing the dictionary
URL: https://github.com/apache/incubator-pinot/pull/4363#discussion_r297260962
 
 

 ##########
 File path: 
pinot-core/src/main/java/org/apache/pinot/core/indexsegment/mutable/MutableSegmentImpl.java
 ##########
 @@ -165,9 +164,11 @@ public long getLatestIngestionTimestamp() {
           dictionaryColumnSize = dataType.size();
         }
         String allocationContext = buildAllocationContext(_segmentName, 
column, V1Constants.Dict.FILE_EXTENSION);
+        // NOTE: preserve 20% buffer for cardinality to reduce the chance of 
re-sizing the dictionary
+        int estimatedCardinality = (int) 
(_statsHistory.getEstimatedCardinality(column) * 1.2);
 
 Review comment:
   I think 10% should be sufficient, but then I agree that both 10 and 20 
percent are arbitrary. Why not make this a per-machine config? Default can be 
10, and we can play with it as needed.
   

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

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

Reply via email to