github-actions[bot] commented on code in PR #67019:
URL: https://github.com/apache/doris/pull/67019#discussion_r3840355885
##########
be/src/storage/segment/segment.cpp:
##########
@@ -519,8 +537,19 @@ Status Segment::new_iterator(ReadSchemaSPtr schema, const
StorageReadOptions& re
options_with_pruned_predicates.zonemap_always_true_pred_cols.insert(pred_cid);
Review Comment:
[P1] Preserve NULLs for aliased COUNT_ON_INDEX inputs. This reduced plan is
reachable:
```text
Aggregate(count(x#alias))
Project(v#source AS x#alias)
Filter(is_null(v#source))
Scan(v#source)
```
The project-form Nereids rule runs `checkIsNullExpr` against aggregate slot
`x` before `Project.findProject` normalizes it back to filter slot `v`, so the
different ExprIds let this pass and later select COUNT_ON_INDEX. On an all-NULL
segment, the new `IS NULL` all-match result removes the predicate and this
marker makes `_need_read_data(v)` emit non-NULL defaults. The Project maps
those defaults to `x`, so `COUNT(x)` returns the qualifying row count instead
of 0. Please normalize the aggregate slots before the IS NULL guard (and add
this aliased regression), or preserve the proven NULLness in the BE no-read
path.
##########
be/src/exprs/expr_zonemap_filter.cpp:
##########
@@ -461,22 +473,39 @@ ZoneMapFilterResult eval_in_zonemap(const
ZoneMapEvalContext& ctx, const VExprSP
return unsupported_zonemap_filter(ctx);
}
+ // The zone range does not reach [min_value, max_value], the range of the
listed values, so
+ // nothing in this zone can be one of them.
+ const bool no_row_is_listed = zone_map.max_value < min_value ||
zone_map.min_value > max_value;
+ // Equal bounds mean every row in the zone holds the same value, so
probing the list once
+ // answers for all of them. Wider ranges cannot be answered this way
because the listed
+ // values leave gaps between min_value and max_value.
+ const bool every_row_is_listed = zone_map.min_value == zone_map.max_value
&&
Review Comment:
[P2] Keep large IN lists behind the point-check cutoff. This new
`any_of(values)` runs before the existing 64-value guard below, so an
equal-bound segment/page scans the entire materialized IN list even when
ordinary IN is supposed to fall back to range-only pruning. The internal reader
and both Parquet page-index loops call this once per page, making a
low-cardinality column with many constant pages and a large SQL/runtime-filter
IN set cost O(pages * set size) Field comparisons; when `can_match_all` is
false, the scan cannot even yield the new proof. Please attempt this IN
all-match membership check only when it can prove all-match and the list is
under the cutoff, or retain a hash-backed probe, and cover a
large-list/equal-bound zone.
--
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]