github-actions[bot] commented on code in PR #66869:
URL: https://github.com/apache/doris/pull/66869#discussion_r3803461704
##########
be/src/storage/index/snii/snii_index_reader.cpp:
##########
@@ -656,11 +656,10 @@ Status SniiIndexReader::_query(const
IndexQueryContextPtr& context, const std::s
ctx->has_complete_common_grams_identity();
};
const bool safety_requires_plain = !common_grams_query_plan_enabled;
- // The raw cache key cannot prove whether the immutable segment analyzer
has CommonGrams until
- // its metadata is open. Delay every eligible forced-plain lookup, then
restore ordinary cache
- // access below only for a segment that cannot contain gram terms.
- const bool initial_force_plain = common_grams_query_eligible &&
safety_requires_plain;
- const bool initial_allow_result_cache = !actual_similarity &&
!initial_force_plain;
+ // An analyzed raw query can only share a cached result after the
immutable segment analyzer
+ // contract has been validated below. Patterns are analyzer-independent
and can still use the
+ // cache before opening the logical reader.
+ const bool initial_allow_result_cache = !actual_similarity &&
raw_pattern_query;
const bool defer_result_cache_lookup = !actual_similarity &&
!initial_allow_result_cache;
const InvertedIndexRawQuerySemantic raw_semantic {
Review Comment:
[P2] Preserve warm cache hits for physical keyword indexes
This gate also defers non-pattern queries on a physical `STRING_TYPE` SNII
index. Such an index cannot carry the analyzer contract this open is meant to
validate: `SniiIndexColumnWriter::init()` uses the same
`should_analyzer(properties)` split as reader construction and rejects
CommonGrams metadata for its keyword lane. Consequently, when the independent
searcher cache is disabled or its entry has been evicted, a repeated
EQUAL/MATCH query now runs `_get_logical_reader()` (including
`open_snii_index()`, potentially remote I/O) before returning the already-warm
bitmap cache entry. Please keep the pre-open lookup for the physical keyword
lane (for example
`!InvertedIndexAnalyzer::should_analyzer(_index_meta.properties())`), while
retaining deferred admission for analyzer-backed readers, and add a
warm-query-cache test with the searcher cache disabled. Do not key this only on
`PARSER_NONE`, since named custom/CommonGrams analyzers use that parser value
too.
--
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]