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


##########
be/src/exec/operator/olap_scan_operator.cpp:
##########
@@ -499,6 +508,36 @@ Status 
OlapScanLocalState::_init_scanners(std::list<ScannerSPtr>* scanners) {
         _cond_ranges.emplace_back(new doris::OlapScanRange());
     }
 
+    // Filter out tablets whose partitions have been pruned by runtime filters.
+    if (_rf_partition_pruner.pruned_partition_count() > 0) {

Review Comment:
   By the time this compaction runs, `OlapScanLocalState::prepare()` has 
already called `get_tablet()` / `capture_read_source()` for every scan range, 
and in cloud mode `init()` / `prepare()` has already kicked off and waited for 
`sync_rowsets()` on every tablet. Since `ScanLocalState::open()` only acquires 
RFs afterwards, ready-at-start RFs still pay the full metadata/read-source 
setup cost for partitions that are immediately dropped here. On wide-partition 
tables that startup work can dominate, so the new feature currently saves 
scanner construction / scan IO, but not the expensive setup work that partition 
pruning was supposed to avoid.



##########
be/src/exec/operator/scan_operator.cpp:
##########
@@ -82,6 +82,7 @@ Status 
ScanLocalStateBase::update_late_arrival_runtime_filter(RuntimeState* stat
             return a->execute_cost() < b->execute_cost();
         });
     };
+    _on_runtime_filter_update();

Review Comment:
   `update_late_arrival_runtime_filter()` does not know whether 
`try_append_late_arrival_runtime_filter()` actually appended a new RF. The only 
"new arrival" check happens later in 
`Scanner::try_append_late_arrival_runtime_filter()` by comparing 
`arrived_rf_num` with `_applied_rf_num`, so this new hook now reruns 
`_do_partition_pruning_by_rf()` on every scanner reschedule while there are 
still unapplied RFs. In the current scanner code `_applied_rf_num` is never 
advanced, which means that after the first late RF arrives we will rescan all 
partition boundaries on every scheduler pass forever. Can we gate this callback 
on "new exprs were appended" before re-entering the pruner?



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