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

colexec: short-circuit hash join when build side is empty #48668

Merged
merged 1 commit into from
May 12, 2020

Conversation

yuzefovich
Copy link
Member

Previously, we would always fully consume both sides of the join, even
when the build (right) side is empty. We can, however, short-circuit in
such case for INNER, RIGHT OUTER, and LEFT SEMI joins and skip probing
phase altogether in such scenarios. For example, this helps query 93 of
TPC-DS benchmark with scale factor 1.

Release note: None

@yuzefovich yuzefovich requested review from asubiotto and a team May 10, 2020 23:34
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@yuzefovich
Copy link
Member Author

I noticed this in the output of tpcdsvec:

09:11:42 test.go:190: test status: [q93] took about 3.69s to run on both configs
09:11:42 test.go:190: test status: WARNING: suboptimal plan when stats are present
no stats: 0.13s	with stats: 3.69s

so I got curious what's going on. Took a look at vectorize=off vs vectorize=on and the former was 12ms whereas the latter was 3s, and then I noticed this inefficiency. Explain analyze for vec=off and for vec=on.

Previously, we would always fully consume both sides of the join, even
when the build (right) side is empty. We can, however, short-circuit in
such case for INNER, RIGHT OUTER, and LEFT SEMI joins and skip probing
phase altogether in such scenarios. For example, this helps query 93 of
TPC-DS benchmark with scale factor 1.

Release note: None
@cockroachdb cockroachdb deleted a comment from blathers-crl bot May 12, 2020
@cockroachdb cockroachdb deleted a comment from blathers-crl bot May 12, 2020
@blathers-crl
Copy link

blathers-crl bot commented May 12, 2020

❌ The GitHub CI (Cockroach) build has failed on 4c860fd2.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@blathers-crl
Copy link

blathers-crl bot commented May 12, 2020

❌ The GitHub CI (Cockroach) build has failed on 4c860fd2.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

Copy link
Contributor

@asubiotto asubiotto left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@yuzefovich
Copy link
Member Author

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented May 12, 2020

Merge conflict (retrying...)

@craig
Copy link
Contributor

craig bot commented May 12, 2020

Build failed (retrying...)

@craig
Copy link
Contributor

craig bot commented May 12, 2020

Build succeeded

@craig craig bot merged commit 91b2880 into cockroachdb:master May 12, 2020
@yuzefovich yuzefovich deleted the hj-shortcircuit branch May 12, 2020 17:39
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