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

perf(553): Optimize incremental join evaluation #557

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

joshua-spacetime
Copy link
Collaborator

@joshua-spacetime joshua-spacetime commented Nov 14, 2023

Fixes #553.

Before this change, we would use the same query plan on both subscription initialization as well as incremental evaluation.
This is problematic for left index joins that read from the right table and probe the index of the left table.
In particular, updates to the left table will use the same query plan, which means they will read the entire right table.
After this change, updates to the left table will only read those updates and probe the index of the right table.

Description of Changes

Please describe your change, mention any related tickets, and so on here.

API and ABI breaking changes

If this is an API or ABI breaking change, please apply the
corresponding GitHub label.

Expected complexity level and risk

How complicated do you think these changes are? Grade on a scale from 1 to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex change.

This complexity rating applies not only to the complexity apparent in the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning ways.

crates/vm/src/expr.rs Outdated Show resolved Hide resolved
@joshua-spacetime joshua-spacetime force-pushed the joshua/perf/553/incremental-join-eval branch 2 times, most recently from 12b5690 to dee576c Compare November 14, 2023 19:51
@joshua-spacetime joshua-spacetime marked this pull request as ready for review November 14, 2023 20:02
crates/vm/src/expr.rs Outdated Show resolved Hide resolved
kulakowski pushed a commit that referenced this pull request Nov 14, 2023
This rolls up PR #557 as of commit dee576c
so that it can be easily deployed to the v0.7.4 release branch.
@joshua-spacetime joshua-spacetime force-pushed the joshua/perf/553/incremental-join-eval branch 2 times, most recently from 284764d to 65a5588 Compare November 15, 2023 05:59
joshua-spacetime added a commit that referenced this pull request Nov 15, 2023
Fixes #553.

This rolls up PR #557 so that it can be easily deployed to the v0.7.4 release branch.
@joshua-spacetime joshua-spacetime enabled auto-merge (rebase) November 15, 2023 06:09
@joshua-spacetime joshua-spacetime force-pushed the joshua/perf/553/incremental-join-eval branch from 65a5588 to 1b3b402 Compare November 15, 2023 18:21
Fixes #553.

Before this change, we would use the same plan for both query and incremental eval.
This is problematic for index joins.
In particular, table sizes are drastically different under incremental eval.
After this change, joins are reordered for incremental eval.
@joshua-spacetime joshua-spacetime force-pushed the joshua/perf/553/incremental-join-eval branch from 1b3b402 to 13b9bc7 Compare November 15, 2023 19:21
Copy link
Contributor

@mamcx mamcx left a comment

Choose a reason for hiding this comment

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

LGTM. I meet to understand this one.

@joshua-spacetime joshua-spacetime merged commit 5a23fad into master Nov 15, 2023
5 checks passed
@joshua-spacetime joshua-spacetime deleted the joshua/perf/553/incremental-join-eval branch November 15, 2023 21:01
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.

Optimize query plans for incremental join evaluation
5 participants