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

Add a system variable to control whether to inline CTE or not #36514

Closed
fixdb opened this issue Jul 25, 2022 · 3 comments · Fixed by #37626 · May be fixed by #37040
Closed

Add a system variable to control whether to inline CTE or not #36514

fixdb opened this issue Jul 25, 2022 · 3 comments · Fixed by #37626 · May be fixed by #37040
Assignees
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@fixdb
Copy link
Contributor

fixdb commented Jul 25, 2022

Enhancement

Currently, CTE can only be inlined through MERGE() hint. But for those queries that have many CTEs, and queries that are generated by BI, it is better to have a system variable to control whether to inline CTE or not.
Suggested var name:
tidb_opt_inline_cte

NB. MERGE() hint can override the tidb_opt_inline_cte variable.

@fixdb fixdb added the type/enhancement The issue or PR belongs to an enhancement. label Jul 25, 2022
@dayicklp
Copy link
Contributor

/assign @dayicklp

@elsa0520
Copy link
Contributor

elsa0520 commented Sep 5, 2022

@elsa0520
Copy link
Contributor

elsa0520 commented Sep 5, 2022

please assign to me ~

elsa0520 added a commit to elsa0520/tidb that referenced this issue Sep 7, 2022
This pr adds a new session variable,
which is mainly used to control whether all CTEs in the entire session are inlined or not.
The default value is false, which means that inline cte is not enabled by default.
(But if the user directly specifies the merge hint, it can still be turned on)
If the variable is set to true, it means that all CTEs for this session try to enable inlining.

Fixed pingcap#36514
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
3 participants