xudong963 commented on PR #27732:
URL: https://github.com/apache/datafusion/pull/27732#issuecomment-7298329955

   > @jayzhan211 do you think the issue here is that the order aware operators 
are slower in general than the non order aware ones? I think that was true 
before this PR as well -- and there is a tradeoff between CPU usage and memory 
for example (your numbers show the tradeoff I think -- 5x slower runtime but 
1/3 the ram (380MB --> 120MB)
   
   Thanks @alamb. I don't think it's the order-aware operators themselves. With 
`target_partitions = 1` both plans run at the same speed (NY `GROUP BY day`: 
1.9 s vs 2.0 s). With 12 partitions, the order-preserving merge drains the 
sorted file ranges one at a time, so the `date_trunc` inside the scan runs on 
one core.
   
   The chrono path for timezone-aware `hour` and coarser costs about 80 ns per 
row, and that's where the 3–6x comes from. Over a timezone-less column, the 
same order-aware plan is actually faster than the sort plan (0.27 s vs 0.57 s).


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