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/07/27 05:07:21 UTC

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

Jackie-Jiang 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_r307953453
 
 

 ##########
 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 can change it to 10%. The long term solution should be expanding the buffers as more values added. Allocating huge buffer at once is a quite slow operation (hundreds milliseconds), which should be avoided.

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