Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement spilling for PartialSortExec #9170

Open
alamb opened this issue Feb 9, 2024 · 2 comments
Open

Implement spilling for PartialSortExec #9170

alamb opened this issue Feb 9, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@alamb
Copy link
Contributor

alamb commented Feb 9, 2024

Is your feature request related to a problem or challenge?

PartialSortExec was added in #7456 / #9125

While one of the major benefits of this operator is to reduce memory required when sorting data (as it can emit early) we should also handle the case when it still can not fit everything in

Describe the solution you'd like

Add spilling support to PartialSortExec so that if it runs out of memory it will spill to disk rather than error

Describe alternatives you've considered

No response

Additional context

#9153 tracks enabling PartialSort for more queries

@alamb alamb added the enhancement New feature or request label Feb 9, 2024
@yyy1000
Copy link
Contributor

yyy1000 commented Feb 15, 2024

I want to help it.
Though it seems not a small project, I think there's spilling implementation in SortExec and I can learn from that.

@alamb
Copy link
Contributor Author

alamb commented Feb 16, 2024

Thanks @yyy1000 -- I would definitely recommend

  1. Studying the existing implementation in Sort
  2. Creating a test case that shows the sort being invoked (aka set memory manager low and create a partial sort plan)
  3. Try and refactor / adapt the parts used in sort to also be used in partial sort

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants