sgup432 commented on PR #16358:
URL: https://github.com/apache/lucene/pull/16358#issuecomment-4890056944

   Example of how the data layout on the disk changes after this PR:
   
   
   **Before (fixed schema, version ≤ 2):**
   ```
     
     Per entry:
       [1B: numLevels]
       per level (high → low):
         [4B: maxDocID] [4B: minDocID] [8B: maxValue] [8B: minValue] [4B: 
docCount]
         = exactly 28 bytes, always
   
     Single-level entry = 1 + 28 = 29 bytes
     Two-level entry    = 1 + 56 = 57 bytes
   
     Reader skips by precomputed offset: 
skipBytes(SKIP_INDEX_JUMP_LENGTH_PER_LEVEL[level])
   ```
     ---
     **After (stats-based, version 3):**
   ```
     
     Per entry:
       [1B: numLevels]
       [4B: intervalLength]
       per level (high → low):
         [4B: maxDocID]
         [4B: entryLength]
         [1B: SKIP_STAT_RANGE (0x01)]
         [4B: minDocID] [8B: maxValue] [8B: minValue] [4B: docCount]
   
     Single-level entry = 1 + 4 + (4 + 4 + 1 + 24) = 38 bytes
     Two-level entry    = 1 + 4 + 2×(4 + 4 + 1 + 24) = 71 bytes
   
     Reader skips by stored length: seek(intervalEnd)
   ```
     ---
     **After, with a future stat (sum) added:**
     ```
     Per entry:
       [1B: numLevels]
       [4B: intervalLength]
       per level (high → low):
         [4B: maxDocID]
         [4B: entryLength]
         [1B: SKIP_STAT_RANGE (0x01)]
         [4B: minDocID] [8B: maxValue] [8B: minValue] [4B: docCount]
         [1B: SKIP_STAT_SUM (0x02)]    ← just appended
         [8B: sumValue]                 ← no other changes 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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to