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

executor: use const generics to optimize hash join #762

Merged
merged 9 commits into from
Jan 8, 2023

Conversation

MingjiHan99
Copy link
Collaborator

@MingjiHan99 MingjiHan99 commented Jan 7, 2023

Generate hash join code in the compilation time to avoid testing join types during the execution for every row.

Signed-off-by: MingjiHan <mjhan@bu.edu>
Signed-off-by: MingjiHan <mjhan@bu.edu>
Signed-off-by: MingjiHan <mjhan@bu.edu>
Signed-off-by: MingjiHan <mjhan@bu.edu>
Signed-off-by: MingjiHan <mjhan@bu.edu>
Signed-off-by: Mingji Han <mjhan@bu.edu>
src/executor_v2/mod.rs Outdated Show resolved Hide resolved
Signed-off-by: MingjiHan <mjhan@bu.edu>
Signed-off-by: Mingji Han <mjhan@bu.edu>
Signed-off-by: Mingji Han <mjhan@bu.edu>
Copy link
Member

@wangrunji0408 wangrunji0408 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment on lines +269 to +271
if matches!(self.node(op), Expr::Inner) {
hash_join_operator!(self, JoinType::Inner, op, lkeys, rkeys, left, right)
} else if matches!(self.node(op), Expr::LeftOuter) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use match instead of if matches!? (It's surprising that there's no clippy warning? 🤔)

BTW just a personal preference not a requirement: I would define the macro just here, and catch local variables directly without passing arguments. 🤪

@MingjiHan99 MingjiHan99 merged commit 8418cf3 into main Jan 8, 2023
@MingjiHan99 MingjiHan99 deleted the hash_join_optimization branch January 8, 2023 17:03
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 this pull request may close these issues.

3 participants