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

commented Oct 12, 2018

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 this to In progress in cascades planner via automation Oct 12, 2018

@zz-jason

This comment has been minimized.

Copy link
Member Author

commented Oct 12, 2018

zz-jason added some commits Oct 12, 2018

@zz-jason

This comment has been minimized.

Copy link
Member Author

commented Oct 12, 2018

/run-all-tests

@eurekaka
Copy link
Contributor

left a comment

LGTM

@winoros
Copy link
Member

left a comment

lgtm

cascades planner automation moved this from In progress to Reviewer approved Oct 12, 2018

@lamxTyler lamxTyler added status/LGT3 and removed status/LGT1 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

This comment has been minimized.

Copy link
@lysu

lysu Oct 12, 2018

Member

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

This comment has been minimized.

Copy link
@zz-jason

zz-jason Oct 12, 2018

Author Member

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

@zz-jason zz-jason merged commit dbdd806 into pingcap:master Oct 12, 2018

4 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci-tidb/build Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

cascades planner automation moved this from Reviewer approved to Done Oct 12, 2018

@zz-jason zz-jason deleted the zz-jason:cascades/session_variable branch Oct 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.