Dandandan opened a new issue, #3579: URL: https://github.com/apache/arrow-datafusion/issues/3579
**Is your feature request related to a problem or challenge? Please describe what you are trying to do.** We recently added optimizations for `ORDER BY expr LIMIT` by pushing limits to individual operations (saving memory, CPU time + limiting output rows) and executing sorts in parallel. The disk spill operation in `SortExec` currently still assumes the to-spill disk doesn't fit in memory. However after sorting we only have to keep the batch(es) with top `fetch` rows and store those, which probably avoids spilling to disk. **Describe the solution you'd like** We can identify that the to-spill data fits in memory after being merged / sorted and avoid spilling to disk. **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. **Additional context** Add any other context or screenshots about the feature request here. -- 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]
