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


##########
be/src/storage/index/snii/snii_index_reader.cpp:
##########
@@ -699,6 +719,19 @@ Status SniiIndexReader::_query(const IndexQueryContextPtr& 
context, const std::s
         }
     }
 
+    // A multi-term phrase restricted to the scan candidates produces a 
partial bitmap. It stays
+    // out of the result cache and single-flight, which both serve the 
full-segment query.
+    const bool consume_candidates =
+            context->candidate_rows != nullptr && 
consumes_candidates(query_type, terms.size());
+    context->candidate_rows_consumed = consume_candidates;

Review Comment:
   [P2] Base candidate consumption on the executor result. This flag and the 
no-cache/no-flight branch are chosen from the multi-term query shape, but the 
phrase executor can return before consulting `candidate_rows`: an absent exact 
term returns a full-domain empty result in `phrase_planned_query.cpp:97-100`, 
and phrase-prefix does the same for a missing exact term or zero tail 
expansions at `:134-157`. Those globally safe empty answers are therefore 
recomputed by every cold/selective scanner and never populate the query cache, 
even though the analogous non-candidate path is coalesced and cached. Please 
propagate whether restriction was actually applied (and cache the direct result 
when it was not), with missing-term/no-expansion coverage for the reply flag 
and second-run cache hit.



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