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

Planner support for VALUES-based BlockJoins #17641

Draft
wants to merge 56 commits into
base: main
Choose a base branch
from

Conversation

frouioui
Copy link
Member

@frouioui frouioui commented Jan 28, 2025

Description

This PR adds query planning support for the new BlockJoin execution strategy, as proposed in the RFC.

We’ve also streamlined the engine primitive, starting with a minimal implementation before introducing advanced features.

To ensure stability, the new join strategy is currently gated behind a feature flag and query hint—it will only be activated if either the feature flag is enabled or the query explicitly includes the /*vt+ ALLOW_BLOCK_JOIN */ directive.

At this stage, usage is restricted to inner joins involving exactly two standard tables. Further development and testing in the planner will be required to support additional query scenarios.

Related Issue(s)

Documentation

Copy link
Contributor

vitess-bot bot commented Jan 28, 2025

Review Checklist

Hello reviewers! 👋 Please follow this checklist when reviewing this Pull Request.

General

  • Ensure that the Pull Request has a descriptive title.
  • Ensure there is a link to an issue (except for internal cleanup and flaky test fixes), new features should have an RFC that documents use cases and test cases.

Tests

  • Bug fixes should have at least one unit or end-to-end test, enhancement and new features should have a sufficient number of tests.

Documentation

  • Apply the release notes (needs details) label if users need to know about this change.
  • New features should be documented.
  • There should be some code comments as to why things are implemented the way they are.
  • There should be a comment at the top of each new or modified test to explain what the test does.

New flags

  • Is this flag really necessary?
  • Flag names must be clear and intuitive, use dashes (-), and have a clear help text.

If a workflow is added or modified:

  • Each item in Jobs should be named in order to mark it as required.
  • If the workflow needs to be marked as required, the maintainer team must be notified.

Backward compatibility

  • Protobuf changes should be wire-compatible.
  • Changes to _vt tables and RPCs need to be backward compatible.
  • RPC changes should be compatible with vitess-operator
  • If a flag is removed, then it should also be removed from vitess-operator and arewefastyet, if used there.
  • vtctl command output order should be stable and awk-able.

@vitess-bot vitess-bot bot added NeedsBackportReason If backport labels have been applied to a PR, a justification is required NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsIssue A linked issue is missing for this Pull Request NeedsWebsiteDocsUpdate What it says labels Jan 28, 2025
@github-actions github-actions bot added this to the v22.0.0 milestone Jan 28, 2025
Copy link

codecov bot commented Jan 28, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 209 lines in your changes missing coverage. Please review.

Project coverage is 67.57%. Comparing base (41a8d1d) to head (4bc5500).
Report is 30 commits behind head on main.

Files with missing lines Patch % Lines
go/vt/vtgate/planbuilder/operators/block_join.go 40.38% 62 Missing ⚠️
go/vt/vtgate/planbuilder/operators/op_to_ast.go 89.90% 32 Missing ⚠️
.../vt/vtgate/planbuilder/operators/query_planning.go 36.58% 26 Missing ⚠️
go/vt/vtgate/planbuilder/operators/block_build.go 51.51% 16 Missing ⚠️
...o/vt/vtgate/planbuilder/operators/query_builder.go 66.66% 15 Missing ⚠️
go/vt/vtgate/engine/block_join.go 41.66% 14 Missing ⚠️
go/vt/vtgate/planbuilder/operators/phases.go 84.50% 11 Missing ⚠️
go/vt/vtgate/planbuilder/operators/misc_routing.go 23.07% 10 Missing ⚠️
go/vt/vtgate/planbuilder/operator_transformers.go 63.63% 8 Missing ⚠️
go/vt/vtgate/planbuilder/operators/route.go 33.33% 4 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17641      +/-   ##
==========================================
+ Coverage   67.50%   67.57%   +0.06%     
==========================================
  Files        1595     1600       +5     
  Lines      259640   260262     +622     
==========================================
+ Hits       175280   175864     +584     
- Misses      84360    84398      +38     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@frouioui frouioui added Type: Feature Component: Query Serving and removed NeedsWebsiteDocsUpdate What it says NeedsIssue A linked issue is missing for this Pull Request NeedsBackportReason If backport labels have been applied to a PR, a justification is required labels Jan 29, 2025
@frouioui frouioui force-pushed the values-join-planner branch from 57f12cf to ea41169 Compare February 4, 2025 15:36
@systay systay force-pushed the values-join-planner branch from ea41169 to 0c70b4f Compare February 5, 2025 14:29
@frouioui frouioui force-pushed the values-join-planner branch from 762b226 to b824a25 Compare February 13, 2025 13:26
@systay systay force-pushed the values-join-planner branch 2 times, most recently from e82817a to 671b022 Compare February 20, 2025 13:19
@frouioui frouioui force-pushed the values-join-planner branch from 671b022 to 31fea9e Compare February 20, 2025 14:03
@systay systay force-pushed the values-join-planner branch from 1607f03 to 24c359f Compare February 20, 2025 14:51
@systay systay force-pushed the values-join-planner branch 3 times, most recently from 59154c7 to be1c49b Compare February 25, 2025 12:32
@frouioui frouioui force-pushed the values-join-planner branch from be1c49b to 950edc4 Compare February 25, 2025 15:21
@systay systay force-pushed the values-join-planner branch from d0a3841 to 745153e Compare March 11, 2025 08:02
systay added 2 commits March 11, 2025 11:32
Signed-off-by: Andres Taylor <[email protected]>
@systay systay changed the title Planner support for VALUES-based Joins Planner support for VALUES-based BlockJoins Mar 11, 2025
systay added 2 commits March 11, 2025 12:12
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
@frouioui frouioui force-pushed the values-join-planner branch from eb3831f to aa1b7f5 Compare March 11, 2025 14:47
@systay systay force-pushed the values-join-planner branch from aa1b7f5 to c4c9c39 Compare March 12, 2025 14:46
@frouioui frouioui force-pushed the values-join-planner branch from c4c9c39 to 39bfa1b Compare March 12, 2025 15:57
@systay systay force-pushed the values-join-planner branch from 39bfa1b to 492dd46 Compare March 13, 2025 07:22
@systay systay force-pushed the values-join-planner branch from 66f8328 to bbcd744 Compare March 13, 2025 11:42
systay and others added 6 commits March 13, 2025 12:51
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
@frouioui frouioui added the release notes (needs details) This PR needs to be listed in the release notes in a dedicated section (deprecation notice, etc...) label Mar 13, 2025
@systay systay force-pushed the values-join-planner branch from 3781dc1 to b0dbcec Compare March 14, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Query Serving release notes (needs details) This PR needs to be listed in the release notes in a dedicated section (deprecation notice, etc...) Type: Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants