github-actions[bot] commented on code in PR #69776:
URL: https://github.com/apache/doris/pull/69776#discussion_r4432112388
##########
be/src/storage/segment/segment_iterator.cpp:
##########
@@ -1282,6 +1281,75 @@ Status SegmentIterator::_apply_ann_topn_predicate() {
return Status::OK();
}
+void SegmentIterator::_reset_range_iterator() {
+ // TopN pruning can replace the bitmap between batches. Refresh the cached
cardinality with
+ // the cursor so batch sizing does not use the larger range from before
the bound arrived.
+ _row_bitmap_cardinality = _row_bitmap.cardinality();
+ if (_opts.read_orderby_key_reverse) {
+ _range_iter.reset(new BackwardBitmapRangeIterator(_row_bitmap));
+ } else {
+ _range_iter.reset(new BitmapRangeIterator(_row_bitmap));
+ }
+}
+
+Status SegmentIterator::_update_topn_runtime_filter_ranges() {
+ // Apply the first bound immediately and throttle later changes by raw
rows read.
Review Comment:
[P2] Preserve the mutable TopN predicate as a row-level residual after
inverted-index evaluation. With a BKD index,
`_apply_inverted_index_on_column_predicate` can consume the `SharedPredicate`
while its bound is null (or consume an earlier bound); when a later bound is
published, this call only intersects page-level zone-map ranges. A mixed page
spanning the new boundary remains in `_row_bitmap`, and `_col_predicates` no
longer checks individual rows, so values outside the bound are emitted and late
TopN pruning is lost. Keep or re-evaluate the shared predicate row-wise and add
a BKD-index test with a mixed page and a late tighter bound.
--
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]