You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2019/06/25 15:49:44 UTC

[GitHub] [incubator-pinot] 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

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org