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 improvements #9545

Merged
merged 8 commits into from
Jan 27, 2022
Merged

Conversation

systay
Copy link
Collaborator

@systay systay commented Jan 20, 2022

Description

Two minor planner improvements - first a query hint that allow users to select the planner to use. Sometimes we want to be able to specify a different planner than the one the vtgate is configured with, and this query hint enables this.

select /*vt+ PLANNER=gen4 */ * from commerce;

Also re-introduces the left-to-right planner which mimics straight join on mysql, which was lost during the refactor of gen4 this week.

@systay
Copy link
Collaborator Author

systay commented Jan 20, 2022

@frouioui WDYT - should we use this to replace the GEN4_COMPARE_ONLY_GEN4 annotations?

Copy link
Member

@GuptaManan100 GuptaManan100 left a comment

Choose a reason for hiding this comment

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

Do we need a test for the left to right solver?

@systay systay added Component: Query Serving release notes Type: Enhancement Logical improvement (somewhere between a bug and feature) labels Jan 21, 2022
@harshit-gangal
Copy link
Member

@frouioui WDYT - should we use this to replace the GEN4_COMPARE_ONLY_GEN4 annotations?

this would basically mean that set PLANNER=Gen4 in the comment. I think we can do that.

@systay systay force-pushed the planner-improvements branch from 282b3d9 to 29e2668 Compare January 21, 2022 07:34
@harshit-gangal
Copy link
Member

looks like we have something already GEN4_COMPARE_ONLY_V3, GEN4_COMPARE_ONLY_GEN4but those names were not intuitive to use, this looks good.

@systay systay force-pushed the planner-improvements branch from 29e2668 to e233de3 Compare January 22, 2022 08:52
@frouioui
Copy link
Member

@frouioui WDYT - should we use this to replace the GEN4_COMPARE_ONLY_GEN4 annotations?

Yes, that is a good idea!

@systay systay force-pushed the planner-improvements branch from c1cd3db to 359266c Compare January 25, 2022 07:36
@harshit-gangal harshit-gangal merged commit ca3e191 into vitessio:main Jan 27, 2022
@harshit-gangal harshit-gangal deleted the planner-improvements branch January 27, 2022 09:01
@aquarapid
Copy link
Contributor

Noting the valid values for the comment (/*vt+ PLANNER=xxx */):

  • v3
  • gen4
  • gen4greedy or greedy
  • left2right
  • gen4fallback
  • gen4comparev3

@systay
Copy link
Collaborator Author

systay commented Feb 1, 2022

Docs added: https://vitess.io/docs/13.0/reference/compatibility/query_planner/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Query Serving Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants