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


##########
be/src/storage/index/inverted/inverted_index_reader.cpp:
##########
@@ -477,7 +481,13 @@ Status FullTextIndexReader::query(const 
IndexQueryContextPtr& context,
             RETURN_IF_ERROR(match_index_search(context, query_type, 
query_info, *searcher_ptr,
                                                term_match_bitmap));
             term_match_bitmap->runOptimize();
-            cache->insert(cache_key, term_match_bitmap, &cache_handler);
+            // Only a bitmap whose query actually joined the candidate set is
+            // partial and must stay out of the cache; a non-consuming query
+            // (MATCH_ANY/ALL, term, regexp, single-term phrase) computed the
+            // full-segment result even while candidate_rows was published.
+            if (!context->candidate_rows_consumed) {
+                cache->insert(cache_key, term_match_bitmap, &cache_handler);

Review Comment:
   [P2] Honor the disabled result-cache option on this full-result path. The 
new benchmark sets `enable_inverted_index_query_cache=false`, but lookup then 
short-circuits while this direct `cache->insert()` still allocates/inserts an 
LRU entry for every unrestricted V2 sample; candidate-consuming samples skip 
this branch, so the reported full/restricted timing is asymmetric. It also 
means a production query that opted out still populates the cache. Please call 
the existing option-aware `insert_query_cache(...)` helper inside this 
partial-result fence (and in the parallel String-reader branch), with a CLucene 
cache-disabled assertion.



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