zhuqi-lucas commented on code in PR #27450:
URL: https://github.com/apache/datafusion/pull/27450#discussion_r4779580960


##########
datafusion/physical-optimizer/src/pushdown_sort.rs:
##########
@@ -177,7 +182,53 @@ fn pushdown_sorts(
             }
         }
 
-        // Pattern 2: Standalone SortExec (no SPM parent)
+        // Pattern 2: Ungrouped single-column MIN/MAX AggregateExec.

Review Comment:
   A further idea, here or as a follow-up: with a `WHERE`, a row group whose 
statistics show every row passes the filter (fully matched, which the pruner 
already detects) has its `MAX(ts)` equal to its `ts` max statistic, so it 
wouldn't need decoding at all. `aggregate_statistics` can't help once there is 
a filter because the file-level stats are no longer exact, but per row group 
the fully matched ones could answer from statistics, and only partially matched 
ones would be decoded.



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