9aman opened a new pull request, #19039:
URL: https://github.com/apache/pinot/pull/19039

   ## Problem
   
   `SelectionQuerySegmentPruner` decrements the LIMIT budget by each segment's 
raw `getTotalDocs()` and prunes trailing segments. When a segment applies a 
post-selection doc mask that removes rows at query time (beyond upsert's 
`validDocIds`), the raw count overstates the surviving rows, so `SELECT ... 
LIMIT n` and `ORDER BY ... LIMIT n` can under-return — a correct prefix, short 
by the removed fraction. `count(*)` / aggregations are unaffected (the pruner 
is not applicable to them).
   
   ## Change
   
   - Add `IndexSegment#hasDeletedDocIds()` (default `false`): a generic signal, 
independent of upsert, that a segment carries externally-supplied deleted docs 
— counted in total docs but excluded at query time.
   - `SelectionQuerySegmentPruner` skips pruning when the first segment reports 
it, mirroring the existing upsert `getValidDocIds()` guard.
   - `ImmutableSegmentImpl` gains `setHasDeletedDocIds(...)` so callers can 
mark such segments.
   
   Default-`false` on the interface keeps all existing segment types unaffected.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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