itschrispeck commented on code in PR #15685:
URL: https://github.com/apache/pinot/pull/15685#discussion_r2105238509


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/realtime/impl/json/MutableJsonIndexImpl.java:
##########
@@ -117,9 +131,15 @@ private void addFlattenedRecords(List<Map<String, String>> 
records) {
       for (Map.Entry<String, String> entry : record.entrySet()) {
         // Put both key and key-value into the posting list. Key is useful for 
checking if a key exists in the json.
         String key = entry.getKey();
-        _postingListMap.computeIfAbsent(key, k -> new 
RoaringBitmap()).add(_nextFlattenedDocId);
+        _postingListMap.computeIfAbsent(key, k -> {
+          _bytesSize += Utf8.encodedLength(key);

Review Comment:
   I don't see this being an issue in profiling - in our logging use case we 
often see multibyte chars and the additional accuracy is helpful
   
   <img width="500" alt="image" 
src="https://github.com/user-attachments/assets/4802c472-af5a-4a3c-bae1-86cf6c737d4b";
 />
   
   normalized to compare cost against just the calling MutableJsonIndex.add 
method, it consists of .15% of samples for high cardinality ingestion/worst 
case scenario (lots of new keys requiring the call)



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

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to