airborne12 commented on code in PR #67180:
URL: https://github.com/apache/doris/pull/67180#discussion_r4090458654
##########
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:
Confirmed with a failing regression before the fix: a missing phrase term, a
missing prefix exact term, and zero prefix expansions all returned empty while
incorrectly reporting candidate consumption and skipping cache insertion.
Commit 200035e42c9 reports consumption from the phrase executor and caches
direct results when candidates were not used. The ASAN candidate test suite
passes 9/9: each globally empty case inserts into the cache and hits on the
second run; a candidate-restricted empty result remains uncached. The cold
candidate path still skips single-flight because it may produce a partial
result before execution determines the outcome.
--
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]