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


##########
be/src/storage/segment/segment_iterator.cpp:
##########
@@ -2057,6 +2060,55 @@ Status SegmentIterator::_init_index_iterators() {
     return Status::OK();
 }
 
+Status SegmentIterator::_drop_placeholder_hidden_column_index(ColumnId cid) {
+    DCHECK(_index_iterators[cid] != nullptr);
+    const auto& column = *_schema->column(cid);
+    if 
(!is_load_placeholder_hidden_column(get_read_time_hidden_column_type(column))) {
+        return Status::OK();
+    }
+    // Index queries take their options from the query's RuntimeState (see
+    // InvertedIndexReader::handle_searcher_cache); compaction, schema change 
and index builds read
+    // without one and evaluate no index.
+    if (_opts.runtime_state == nullptr) {

Review Comment:
   [P2] Honor disabled inverted-index queries before probing hidden indexes. 
This guard only checks for a RuntimeState, so 
`enable_inverted_index_query=false` still runs the `= 0` index query during 
initialization. For a multi-version rowset with an old all-zero VERSION index, 
`skip_try=true` retrieves postings for every row before key/predicate pruning, 
even though the later index-application paths are disabled. With the 
query/searcher caches disabled, every scan pays this index I/O and decoding 
cost; a scan selective on another column can therefore process the entire 
hidden-column index despite explicitly opting out. Check 
`enable_inverted_index_query` before this compatibility probe (or defer the 
probe until the index is consumed), and cover a disabled-index scan that never 
calls `read_from_index`.



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