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

Introduce physical plan and add switch #4820

Merged

Conversation

SeaRise
Copy link
Contributor

@SeaRise SeaRise commented May 5, 2022

What problem does this PR solve?

Issue Number: ref #4739

Problem Summary:

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented May 5, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • windtalker
  • ywqzzy

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 5, 2022
@ywqzzy ywqzzy self-requested a review May 5, 2022 06:04
@purelind
Copy link
Collaborator

purelind commented May 5, 2022

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented May 5, 2022

Coverage for changed files

Filename                                  Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Flash/Coprocessor/InterpreterDAG.cpp           25                25     0.00%           5                 5     0.00%          70                70     0.00%          18                18     0.00%
Flash/Planner/PhysicalPlan.cpp                  9                 9     0.00%           7                 7     0.00%          42                42     0.00%           2                 2     0.00%
Flash/Planner/PhysicalPlan.h                    7                 7     0.00%           7                 7     0.00%           7                 7     0.00%           0                 0         -
Flash/Planner/PhysicalPlanBuilder.cpp           1                 1     0.00%           1                 1     0.00%           3                 3     0.00%           0                 0         -
Flash/Planner/PhysicalPlanBuilder.h            13                13     0.00%           2                 2     0.00%           5                 5     0.00%           4                 4     0.00%
Flash/Planner/PhysicalPlanHelper.cpp            2                 2     0.00%           1                 1     0.00%           7                 7     0.00%           2                 2     0.00%
Flash/Planner/PlanType.cpp                      3                 3     0.00%           1                 1     0.00%           9                 9     0.00%           4                 4     0.00%
Flash/Planner/Planner.cpp                      11                11     0.00%           6                 6     0.00%          32                32     0.00%           6                 6     0.00%
Flash/Planner/Planner.h                         1                 1     0.00%           1                 1     0.00%           1                 1     0.00%           0                 0         -
Flash/Planner/plans/PhysicalLeaf.h              5                 5     0.00%           5                 5     0.00%          11                11     0.00%           0                 0         -
Flash/Planner/plans/PhysicalSource.h            6                 6     0.00%           5                 5     0.00%          12                12     0.00%           2                 2     0.00%
Interpreters/Settings.h                         1                 0   100.00%           1                 0   100.00%           1                 0   100.00%           0                 0         -
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                          84                83     1.19%          42                41     2.38%         200               199     0.50%          38                38     0.00%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
17294      9451             45.35%    194482  95962        50.66%

full coverage report (for internal network access only)

@purelind
Copy link
Collaborator

purelind commented May 5, 2022

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented May 5, 2022

Coverage for changed files

Filename                                  Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Flash/Coprocessor/InterpreterDAG.cpp           25                25     0.00%           5                 5     0.00%          70                70     0.00%          18                18     0.00%
Flash/Planner/PhysicalPlan.cpp                  9                 9     0.00%           7                 7     0.00%          42                42     0.00%           2                 2     0.00%
Flash/Planner/PhysicalPlan.h                    7                 7     0.00%           7                 7     0.00%           7                 7     0.00%           0                 0         -
Flash/Planner/PhysicalPlanBuilder.cpp           1                 1     0.00%           1                 1     0.00%           3                 3     0.00%           0                 0         -
Flash/Planner/PhysicalPlanBuilder.h            13                13     0.00%           2                 2     0.00%           5                 5     0.00%           4                 4     0.00%
Flash/Planner/PhysicalPlanHelper.cpp            2                 2     0.00%           1                 1     0.00%           7                 7     0.00%           2                 2     0.00%
Flash/Planner/PlanType.cpp                      3                 3     0.00%           1                 1     0.00%           9                 9     0.00%           4                 4     0.00%
Flash/Planner/Planner.cpp                      11                11     0.00%           6                 6     0.00%          32                32     0.00%           6                 6     0.00%
Flash/Planner/Planner.h                         1                 1     0.00%           1                 1     0.00%           1                 1     0.00%           0                 0         -
Flash/Planner/plans/PhysicalLeaf.h              5                 5     0.00%           5                 5     0.00%          11                11     0.00%           0                 0         -
Flash/Planner/plans/PhysicalSource.h            6                 6     0.00%           5                 5     0.00%          12                12     0.00%           2                 2     0.00%
Interpreters/Settings.h                         1                 0   100.00%           1                 0   100.00%           1                 0   100.00%           0                 0         -
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                          84                83     1.19%          42                41     2.38%         200               199     0.50%          38                38     0.00%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
17294      9451             45.35%    194482  95973        50.65%

full coverage report (for internal network access only)

@SeaRise
Copy link
Contributor Author

SeaRise commented May 5, 2022

/hold

@ti-chi-bot ti-chi-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 5, 2022
@SeaRise SeaRise changed the title Introduce physical plan add switch Introduce physical plan and add switch May 10, 2022
@SeaRise
Copy link
Contributor Author

SeaRise commented May 10, 2022

/run-all-tests

@SeaRise SeaRise mentioned this pull request May 10, 2022
13 tasks
@SeaRise
Copy link
Contributor Author

SeaRise commented May 10, 2022

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented May 10, 2022

Coverage for changed files

Filename                                  Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Flash/Coprocessor/InterpreterDAG.cpp           25                25     0.00%           5                 5     0.00%          70                70     0.00%          18                18     0.00%
Flash/Planner/PhysicalPlan.cpp                  9                 9     0.00%           7                 7     0.00%          42                42     0.00%           2                 2     0.00%
Flash/Planner/PhysicalPlan.h                    7                 7     0.00%           7                 7     0.00%           7                 7     0.00%           0                 0         -
Flash/Planner/PhysicalPlanBuilder.cpp           1                 1     0.00%           1                 1     0.00%           3                 3     0.00%           0                 0         -
Flash/Planner/PhysicalPlanBuilder.h            13                13     0.00%           2                 2     0.00%           5                 5     0.00%           4                 4     0.00%
Flash/Planner/PhysicalPlanHelper.cpp            2                 2     0.00%           1                 1     0.00%           7                 7     0.00%           2                 2     0.00%
Flash/Planner/PlanType.cpp                      3                 3     0.00%           1                 1     0.00%           9                 9     0.00%           4                 4     0.00%
Flash/Planner/Planner.cpp                      11                11     0.00%           6                 6     0.00%          32                32     0.00%           6                 6     0.00%
Flash/Planner/Planner.h                         1                 1     0.00%           1                 1     0.00%           1                 1     0.00%           0                 0         -
Flash/Planner/optimize.cpp                      5                 5     0.00%           4                 4     0.00%          12                12     0.00%           2                 2     0.00%
Flash/Planner/plans/PhysicalLeaf.h              5                 5     0.00%           5                 5     0.00%          11                11     0.00%           0                 0         -
Flash/Planner/plans/PhysicalSource.h            6                 6     0.00%           5                 5     0.00%          12                12     0.00%           2                 2     0.00%
Interpreters/Settings.h                         1                 0   100.00%           1                 0   100.00%           1                 0   100.00%           0                 0         -
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                          89                88     1.12%          46                45     2.17%         212               211     0.47%          40                40     0.00%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
17298      9454             45.35%    194494  95980        50.65%

full coverage report (for internal network access only)

@SeaRise
Copy link
Contributor Author

SeaRise commented May 10, 2022

/run-all-tests

@SeaRise
Copy link
Contributor Author

SeaRise commented May 25, 2022

/run-check-issue-triage-complete

pull_request:
branches:
- master
- planner_refactory
Copy link
Contributor Author

@SeaRise SeaRise Jun 8, 2022

Choose a reason for hiding this comment

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

Modified for license checker.
I'll revert it to master at the last pr

@SeaRise
Copy link
Contributor Author

SeaRise commented Jun 8, 2022

/run-all-tests

@SeaRise
Copy link
Contributor Author

SeaRise commented Jun 8, 2022

/cc @ywqzzy @windtalker

@sre-bot
Copy link
Collaborator

sre-bot commented Jun 8, 2022

Coverage for changed files

Filename                                      Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Common/TiFlashException.h                           8                 4    50.00%           6                 4    33.33%           6                 4    33.33%           4                 2    50.00%
Flash/Coprocessor/InterpreterDAG.cpp               33                 8    75.76%           5                 0   100.00%          74                19    74.32%          24                 9    62.50%
Flash/Planner/PhysicalPlan.cpp                     10                10     0.00%           8                 8     0.00%          43                43     0.00%           2                 2     0.00%
Flash/Planner/PhysicalPlan.h                        6                 6     0.00%           6                 6     0.00%           6                 6     0.00%           0                 0         -
Flash/Planner/PhysicalPlanBuilder.cpp               1                 1     0.00%           1                 1     0.00%           3                 3     0.00%           0                 0         -
Flash/Planner/PhysicalPlanBuilder.h                13                13     0.00%           2                 2     0.00%           5                 5     0.00%           4                 4     0.00%
Flash/Planner/PhysicalPlanHelper.cpp                2                 2     0.00%           1                 1     0.00%           7                 7     0.00%           2                 2     0.00%
Flash/Planner/PlanType.cpp                          3                 3     0.00%           1                 1     0.00%           9                 9     0.00%           4                 4     0.00%
Flash/Planner/PlanType.h                            3                 3     0.00%           3                 3     0.00%           8                 8     0.00%           0                 0         -
Flash/Planner/Planner.cpp                          22                21     4.55%           6                 5    16.67%          32                29     9.38%          10                10     0.00%
Flash/Planner/Planner.h                             1                 1     0.00%           1                 1     0.00%           1                 1     0.00%           0                 0         -
Flash/Planner/optimize.cpp                          5                 5     0.00%           4                 4     0.00%          13                13     0.00%           2                 2     0.00%
Flash/Planner/plans/PhysicalLeaf.h                  5                 5     0.00%           5                 5     0.00%          11                11     0.00%           0                 0         -
Flash/Planner/plans/PhysicalSource.h                6                 6     0.00%           5                 5     0.00%          12                12     0.00%           2                 2     0.00%
Flash/tests/gtest_planner_interpreter.cpp         146                57    60.96%           4                 0   100.00%         632                 0   100.00%          12                12     0.00%
Flash/tests/gtest_qb_interpreter.cpp              146                57    60.96%           4                 0   100.00%         632                 0   100.00%          12                12     0.00%
Interpreters/Settings.h                             1                 0   100.00%           1                 0   100.00%           1                 0   100.00%           0                 0         -
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                             411               202    50.85%          63                46    26.98%        1495               170    88.63%          78                61    21.79%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18359      9679             47.28%    206557  96709        53.18%

full coverage report (for internal network access only)

dbms/src/Flash/Planner/Planner.h Outdated Show resolved Hide resolved
dbms/src/Flash/Planner/optimize.cpp Show resolved Hide resolved
@@ -19,13 +19,15 @@ namespace DB
{
namespace tests
{
class InterpreterExecuteTest : public DB::tests::ExecutorTest
class PlannerInterpreterExecuteTest : public DB::tests::ExecutorTest
Copy link
Contributor Author

Choose a reason for hiding this comment

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

input of gtest_planner_interpreter is same as gtest_qb_interpreter

@ywqzzy ywqzzy self-requested a review June 9, 2022 03:42
@SeaRise
Copy link
Contributor Author

SeaRise commented Jun 9, 2022

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Jun 9, 2022

Coverage for changed files

Filename                                      Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Common/TiFlashException.h                           8                 4    50.00%           6                 4    33.33%           6                 4    33.33%           4                 2    50.00%
Flash/Coprocessor/InterpreterDAG.cpp               33                 8    75.76%           5                 0   100.00%          74                19    74.32%          24                 9    62.50%
Flash/Planner/PhysicalPlan.cpp                     10                10     0.00%           8                 8     0.00%          43                43     0.00%           2                 2     0.00%
Flash/Planner/PhysicalPlan.h                        6                 6     0.00%           6                 6     0.00%           6                 6     0.00%           0                 0         -
Flash/Planner/PhysicalPlanBuilder.cpp               1                 1     0.00%           1                 1     0.00%           3                 3     0.00%           0                 0         -
Flash/Planner/PhysicalPlanBuilder.h                13                13     0.00%           2                 2     0.00%           5                 5     0.00%           4                 4     0.00%
Flash/Planner/PhysicalPlanHelper.cpp                2                 2     0.00%           1                 1     0.00%           7                 7     0.00%           2                 2     0.00%
Flash/Planner/PlanType.cpp                          3                 3     0.00%           1                 1     0.00%           9                 9     0.00%           4                 4     0.00%
Flash/Planner/PlanType.h                            3                 3     0.00%           3                 3     0.00%           8                 8     0.00%           0                 0         -
Flash/Planner/Planner.cpp                          22                21     4.55%           6                 5    16.67%          32                29     9.38%          10                10     0.00%
Flash/Planner/Planner.h                             1                 1     0.00%           1                 1     0.00%           1                 1     0.00%           0                 0         -
Flash/Planner/optimize.cpp                          5                 5     0.00%           4                 4     0.00%          13                13     0.00%           2                 2     0.00%
Flash/Planner/plans/PhysicalLeaf.h                  5                 5     0.00%           5                 5     0.00%          11                11     0.00%           0                 0         -
Flash/Planner/plans/PhysicalSource.h                6                 6     0.00%           5                 5     0.00%          12                12     0.00%           2                 2     0.00%
Flash/tests/gtest_planner_interpreter.cpp         146                57    60.96%           4                 0   100.00%         632                 0   100.00%          12                12     0.00%
Flash/tests/gtest_qb_interpreter.cpp              146                57    60.96%           4                 0   100.00%         632                 0   100.00%          12                12     0.00%
Interpreters/Settings.h                             1                 0   100.00%           1                 0   100.00%           1                 0   100.00%           0                 0         -
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                             411               202    50.85%          63                46    26.98%        1495               170    88.63%          78                61    21.79%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18359      9679             47.28%    206557  96677        53.20%

full coverage report (for internal network access only)

dbms/src/Flash/Planner/PlanType.h Show resolved Hide resolved
dbms/src/Flash/Planner/Planner.h Outdated Show resolved Hide resolved
dbms/src/Flash/Coprocessor/InterpreterDAG.cpp Show resolved Hide resolved
@SeaRise SeaRise requested a review from windtalker June 10, 2022 08:16
Copy link
Contributor

@windtalker windtalker left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 13, 2022
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 13, 2022
@SeaRise
Copy link
Contributor Author

SeaRise commented Jun 13, 2022

/merge

@ti-chi-bot
Copy link
Member

@SeaRise: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: d31b310

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 13, 2022
@sre-bot
Copy link
Collaborator

sre-bot commented Jun 13, 2022

Coverage for changed files

Filename                                      Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Common/TiFlashException.h                           8                 4    50.00%           6                 4    33.33%           6                 4    33.33%           4                 2    50.00%
Flash/Coprocessor/InterpreterDAG.cpp               33                 8    75.76%           5                 0   100.00%          74                19    74.32%          24                 9    62.50%
Flash/Planner/PhysicalPlan.cpp                     10                10     0.00%           8                 8     0.00%          43                43     0.00%           2                 2     0.00%
Flash/Planner/PhysicalPlan.h                        6                 6     0.00%           6                 6     0.00%           6                 6     0.00%           0                 0         -
Flash/Planner/PhysicalPlanBuilder.cpp               1                 1     0.00%           1                 1     0.00%           3                 3     0.00%           0                 0         -
Flash/Planner/PhysicalPlanBuilder.h                13                13     0.00%           2                 2     0.00%           5                 5     0.00%           4                 4     0.00%
Flash/Planner/PhysicalPlanHelper.cpp                2                 2     0.00%           1                 1     0.00%           7                 7     0.00%           2                 2     0.00%
Flash/Planner/PlanType.cpp                          3                 3     0.00%           1                 1     0.00%           9                 9     0.00%           4                 4     0.00%
Flash/Planner/PlanType.h                            3                 3     0.00%           3                 3     0.00%           8                 8     0.00%           0                 0         -
Flash/Planner/Planner.cpp                          22                21     4.55%           6                 5    16.67%          32                29     9.38%          10                10     0.00%
Flash/Planner/Planner.h                             1                 1     0.00%           1                 1     0.00%           1                 1     0.00%           0                 0         -
Flash/Planner/optimize.cpp                          5                 5     0.00%           4                 4     0.00%          13                13     0.00%           2                 2     0.00%
Flash/Planner/plans/PhysicalLeaf.h                  5                 5     0.00%           5                 5     0.00%          11                11     0.00%           0                 0         -
Flash/Planner/plans/PhysicalSource.h                6                 6     0.00%           5                 5     0.00%          12                12     0.00%           2                 2     0.00%
Flash/tests/gtest_planner_interpreter.cpp         146                57    60.96%           4                 0   100.00%         632                 0   100.00%          12                12     0.00%
Flash/tests/gtest_qb_interpreter.cpp              146                57    60.96%           4                 0   100.00%         632                 0   100.00%          12                12     0.00%
Interpreters/Settings.h                             1                 0   100.00%           1                 0   100.00%           1                 0   100.00%           0                 0         -
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                             411               202    50.85%          63                46    26.98%        1495               170    88.63%          78                61    21.79%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18359      9679             47.28%    206557  96693        53.19%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit aabe213 into pingcap:planner_refactory Jun 13, 2022
@SeaRise SeaRise deleted the introduce_physical_plan_add_switch branch June 20, 2022 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants