LuciferYang commented on code in PR #68521:
URL: https://github.com/apache/doris/pull/68521#discussion_r4111573741


##########
be/src/storage/segment/segment.cpp:
##########
@@ -149,11 +162,14 @@ Status segment_zone_maps_can_answer_agg(Segment* segment, 
const ReadSchema& sche
                                         const StorageReadOptions& 
read_options, bool* usable) {
     *usable = true;
     for (size_t ordinal = 0; ordinal < schema.num_block_columns(); ++ordinal) {
-        // The commit-tso column is only served correctly once its reader is 
created with the
-        // rowset's commit_tso as a const value. Creating it here without one 
would cache a reader
-        // that hands every later read the on-disk placeholder instead.
-        if (static_cast<int32_t>(ordinal) == schema.commit_tso_ordinal()) {
-            continue;
+        // A hidden placeholder column (version / commit-tso / binlog-tso) 
carries an on-disk
+        // zonemap that describes the placeholder, not the value rows come 
back with, so a pushed
+        // min/max/count aggregate must not answer from it. Bail the whole 
pushed aggregate. These
+        // columns are only in the read schema when explicitly referenced, so 
plain aggregates that
+        // do not touch them are unaffected.
+        if (segment->placeholder_effective_value(static_cast<int>(ordinal), 
schema, read_options)) {

Review Comment:
   `force_pushdown_zonemap_minmax` is not present on this branch's base 
(`dea1b99e`): here the statistics iterator is always gated by 
`segment_zone_maps_can_answer_agg`, which already bails when a placeholder 
column is referenced, so `MIN/MAX(__DORIS_VERSION_COL__)` reads real data 
rather than the physical `0`. The forced-pushdown bypass is a master-side path 
this branch will pick up on rebase; I'll extend the same placeholder veto to it 
there.
   
   Finding 2 (the physical index bypass) is a real reachable gap and is being 
fixed on this branch: bloom-filter and inverted-index pruning ran before the 
page-zonemap guard, so I now skip placeholder columns in both and let the 
predicate be evaluated at read time, with an indexed-hidden-column regression.



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