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 session variable "tidb_enable_cascades_planner" #7879

Merged
merged 6 commits into from
Oct 12, 2018

Conversation

zz-jason
Copy link
Member

What problem does this PR solve?

This PR is split from #7869

What is changed and how it works?

  • add a session variable tidb_enable_cascades_planner to enable the new cascades planner.
  • move Optimize() out of the package plannercore to planner, chose the query planner according to the session variable tidb_enable_cascades_planner

Because the cascades planner is not implemented yet, an error will be returned if we use the cascades planner to process a query:

TiDB(localhost:4000) > select * from t;
+---+------+------+
| a | b    | c    |
+---+------+------+
| 1 | NULL | NULL |
+---+------+------+
1 row in set (0.00 sec)

TiDB(localhost:4000) > set @@tidb_enable_cascades_planner=on;
Query OK, 0 rows affected (0.00 sec)

TiDB(localhost:4000) > select * from t;
ERROR 1105 (HY000): The cascades planner is not implemented yet.

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

@zz-jason zz-jason added sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement. labels Oct 12, 2018
@zz-jason
Copy link
Member Author

@eurekaka @winoros @lamxTyler PTAL

@zz-jason
Copy link
Member Author

/run-all-tests

Copy link
Contributor

@eurekaka eurekaka left a comment

Choose a reason for hiding this comment

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

LGTM

@eurekaka eurekaka added the status/LGT1 Indicates that a PR has LGTM 1. label Oct 12, 2018
Copy link
Member

@winoros winoros left a comment

Choose a reason for hiding this comment

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

lgtm

@alivxxx alivxxx added status/LGT3 The PR has already had 3 LGTM. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Oct 12, 2018
@@ -289,6 +289,9 @@ type SessionVars struct {
// EnableTablePartition enables table partition feature.
EnableTablePartition bool

// EnableCascadesPlanner enables the cascades planner.
EnableCascadesPlanner bool
Copy link
Contributor

@lysu lysu Oct 12, 2018

Choose a reason for hiding this comment

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

do we need half-open stauts that plan/exec new & old at same time for compare and test?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, will be added once the new planner is functionally work.

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

Successfully merging this pull request may close these issues.

5 participants