github-actions[bot] commented on code in PR #67180:
URL: https://github.com/apache/doris/pull/67180#discussion_r3890096017


##########
be/src/storage/segment/segment_iterator.cpp:
##########
@@ -834,12 +835,28 @@ Status 
SegmentIterator::_get_row_ranges_by_column_conditions() {
             if (_index_query_context != nullptr) {
                 _index_query_context->count_on_index_fastpath = 
_count_on_index_fastpath_safe();
                 _index_query_context->count_on_index_fastpath_hit = false;
+                // Candidate-pushdown handshake: while index conditions are
+                // evaluated, expose the current candidate bitmap so index
+                // queries can restrict themselves to it (two-phase
+                // evaluation). _row_bitmap only shrinks during the applies
+                // below, so restricting to its current state stays correct
+                // for every later conjunct.
+                _refresh_candidate_pushdown();
             }
-            DEFER({ _capture_count_fastpath_hit(); });
+            DEFER({
+                _capture_count_fastpath_hit();
+                if (_index_query_context != nullptr) {
+                    _index_query_context->candidate_rows = nullptr;
+                }
+            });
             // Only apply column-level inverted index if we have iterators
             if (has_index_in_iterators()) {
                 RETURN_IF_ERROR(_apply_inverted_index());
             }
+            // The column predicates above may have shrunk the bitmap across
+            // the engage threshold; refresh the handshake at this conjunct
+            // boundary so the expression conjuncts below still benefit.
+            _refresh_candidate_pushdown();

Review Comment:
   [P2] Include late scan restrictions in the phrase candidate. This is the 
last refresh before phrase evaluation, but condition-derived ranges are 
intersected only later in this function, and `_lazy_init()` applies the 
per-segment delete bitmap and external scanner-split ranges only after the 
function returns and the `DEFER` has cleared `candidate_rows`. A segment above 
the 0.3 gate here but reduced far below it by zone-map/dictionary pruning, MoW 
deletes, or a split range therefore still walks full phrase postings. Please 
form the evaluation candidate from these stable restrictions without making 
condition-cache results partial (or safely apply them earlier), and add 
cold-cache coverage for the late-pruning paths.



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