You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
alamb
changed the title
Optimize "LIMIT" queries for speed / memory with special TopK opeartor
Optimize "LIMIT" queries for speed / memory with special TopK operator
Aug 7, 2023
Is your feature request related to a problem or challenge?
This pattern is common:
For example we have queries in IOx like the following (this is the same pattern @NGA-TRAN describes on #7162)
Describe the solution you'd like
If the data IS NOT already sorted, what happens today is a plan like
And the Sort can take partial advantage of the fetch -- and it will be better after @gruuya 's change in #7180
We can probably do better still with a special operator like the following that uses some specialized structure (perhaps some type of heap)
Describe alternatives you've considered
If the data is already sorted the right way, DataFusion can just read first N values and stop as described on #7162
Additional context
No response
The text was updated successfully, but these errors were encountered: