pub fn aggregate_scan_metrics(plan: &dyn ExecutionPlan) -> ScanMetricsExpand description
Walk the physical-plan tree: output_rows from the root node (final result
grain), bytes_scanned/spilled_bytes/spill_count summed across every
node (leaf DataSourceExec nodes carry bytes_scanned; spilling operators
such as ExternalSorter carry the other two). sum_by_name cannot be used
for the spill counters: MetricsSet::sum_by_name explicitly returns
false for MetricValue::SpillCount/SpilledBytes, so it would silently
report zero; the dedicated MetricsSet::spill_count()/spilled_bytes()
accessors are used instead.