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

sort-merge join #4538

Closed
jangorecki opened this issue Jun 10, 2020 · 1 comment
Closed

sort-merge join #4538

jangorecki opened this issue Jun 10, 2020 · 1 comment

Comments

@jangorecki
Copy link
Member

jangorecki commented Jun 10, 2020

We are now using binary search algorithm when doing join/merge of two tables.
Despite binary search merge (call it bmerge) is a single threaded implementation now, as of now it is still 4 times faster than the next fastest solution, on a 5GB, 1e8 rows data (not taking GPU into account).
I am proposing to have an alternative join algorithm, sort-merge join (call it smerge), that could be used if tables are already sorted by join keys. In sort-merge join, sorting join keys is the most expensive part.

After looking at the timings in #4539 it make sense to use smerge instead of bmerge in many other cases, not just when tables are sorted. Although making bmerge parallel would reduce this timings differences, at least up to currently supported int32 row limit, #3957. I assume sort-merge join to scale little better. In the end it makes a linear scan over sorted integers, so the bigger the data (and chunk sizes), the better utilization of threads.

@jangorecki jangorecki self-assigned this Jun 10, 2020
@jangorecki jangorecki added this to the 1.12.11 milestone Jun 10, 2020
@jangorecki jangorecki mentioned this issue Jun 10, 2020
8 tasks
@jangorecki jangorecki linked a pull request Jun 10, 2020 that will close this issue
8 tasks
@mattdowle mattdowle modified the milestones: 1.13.1, 1.13.3 Oct 17, 2020
@mattdowle mattdowle removed this from the 1.14.1 milestone Aug 28, 2021
@jangorecki jangorecki removed their assignment Dec 10, 2023
@jangorecki
Copy link
Member Author

Some initial work on this has been made in #4539. As I am not going to pursue it anytime soon, and change is rather complex. I will close this for now. If there is a demand, we can always reopen.

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

Successfully merging a pull request may close this issue.

2 participants