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

Support generating leading and hash_join_build hint for quick binding #55280

Closed
time-and-fate opened this issue Aug 7, 2024 · 1 comment · Fixed by #55195
Closed

Support generating leading and hash_join_build hint for quick binding #55280

time-and-fate opened this issue Aug 7, 2024 · 1 comment · Fixed by #55195
Assignees
Labels
sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.

Comments

@time-and-fate
Copy link
Member

time-and-fate commented Aug 7, 2024

Enhancement

In tidb, the create binding from history using plan digest ... functionality relies on the ability of extracting hints from a physical plan.

Current implementation of that module only supports several simple kinds of hints. And we also find it may not be a good idea to implement this functionality in this way.

For now, one important missing hint is leading(), which is the join order hint. We want to enhance this module based on current implementation to support leading(), and also try to generate hash_join_build() hint to replace current hash_join() hint when possible. We may design better method to support this functionality in the future.

@time-and-fate
Copy link
Member Author

Tests

For the SQL patterns or cases below, CREATE BINDING FROM HISTORY USING PLAN DIGEST should successfully create bindings with correct leading() and hash_join_build() hints.

  • Join 4 tables with join keyword in the same query block.
  • Join one table with itself by using table alias in the same query block.
  • Mix normal join and join converted from IN subquery.
  • DML statements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant