HappenLee commented on code in PR #65242:
URL: https://github.com/apache/doris/pull/65242#discussion_r3534761990
##########
be/src/storage/segment/segment_iterator.cpp:
##########
@@ -1471,10 +1464,18 @@ bool SegmentIterator::_need_read_data(ColumnId cid) {
if (unique_id < 0) {
unique_id = column.parent_unique_id();
}
- if ((_need_read_data_indices.contains(cid) &&
!_need_read_data_indices[cid] &&
- !_output_columns.contains(unique_id)) ||
- (_need_read_data_indices.contains(cid) &&
!_need_read_data_indices[cid] &&
- _output_columns.count(unique_id) == 1 &&
+ // A non-key column can skip data reads when its predicates have already
been fully resolved:
+ // either by an index, or by the segment zone map proving all predicates
on this column are
+ // always true and removing them before iterator initialization. Key
columns must remain
+ // readable for short-key range seeks.
+ const bool used_by_common_expr =
+ cid < _is_common_expr_column.size() && _is_common_expr_column[cid];
+ const bool no_need_read_filter_column =
+ (_need_read_data_indices.contains(cid) &&
!_need_read_data_indices[cid]) ||
+ (_opts.zonemap_always_true_pred_cols.contains(cid) &&
!column.is_key() &&
Review Comment:
这里为什么还需要加!column.is_key()的判断呢?添加zonemap_always_true_pred_cols已经判断过了啊
--
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]