alamb commented on code in PR #12099:
URL: https://github.com/apache/datafusion/pull/12099#discussion_r1725332206


##########
datafusion/physical-plan/src/sorts/sort.rs:
##########
@@ -552,7 +552,9 @@ impl ExternalSorter {
         let fetch = self.fetch;
         let expressions = Arc::clone(&self.expr);
         let stream = futures::stream::once(futures::future::lazy(move |_| {
+            let timer = metrics.elapsed_compute().timer();

Review Comment:
   I looked at the rest of this code, and I think there are other non trivial 
consumers of compute (e.g. the call to `concat_batches` above) 
   
   What I would recommend is moving this timer up into the 
`SortExec::in_mem_sort` and add one in  `SortExec::in_mem_sort_stream`



##########
datafusion/physical-plan/src/sorts/sort.rs:
##########
@@ -552,7 +552,9 @@ impl ExternalSorter {
         let fetch = self.fetch;
         let expressions = Arc::clone(&self.expr);
         let stream = futures::stream::once(futures::future::lazy(move |_| {
+            let timer = metrics.elapsed_compute().timer();

Review Comment:
   I did double check and the `streaming_merge` code does seem to track elapsed 
compute reasonably: 
https://github.com/apache/datafusion/blob/37428bb2034abc1aba5d4cd52cf8f2885623bada/datafusion/physical-plan/src/sorts/merge.rs#L170-L173



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to