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

Planner: support table scan #5335

Merged
merged 20 commits into from
Jul 25, 2022

Conversation

SeaRise
Copy link
Contributor

@SeaRise SeaRise commented Jul 11, 2022

What problem does this PR solve?

Issue Number: ref #4739

Problem Summary:

What is changed and how it works?

  • Add PhysicalTableScan and PhysicalMockTableScan.
  • push down filter in PhysicalPlan.cpp
  • use GenSchemaAndColumn.h::genNamesAndTypes to generate table scan schema.

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 Jul 11, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • gengliqi
  • 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 11, 2022
@SeaRise SeaRise mentioned this pull request Jul 11, 2022
13 tasks
@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 11, 2022

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Jul 11, 2022

Coverage for changed files

Filename                                     Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Coprocessor/DAGQueryBlockInterpreter.cpp         230                76    66.96%          31                 4    87.10%         530               112    78.87%         148                53    64.19%
Coprocessor/GenSchemaAndColumn.cpp                12                 4    66.67%           3                 1    66.67%          41                15    63.41%          12                 5    58.33%
Coprocessor/PushDownFilter.cpp                    16                16     0.00%           4                 4     0.00%          36                36     0.00%          12                12     0.00%
Coprocessor/PushDownFilter.h                       2                 2     0.00%           2                 2     0.00%           2                 2     0.00%           0                 0         -
Planner/PhysicalPlan.cpp                          84                30    64.29%          11                 0   100.00%         132                24    81.82%          52                21    59.62%
Planner/PlanType.cpp                              14                 4    71.43%           1                 0   100.00%          31                 8    74.19%          26                 4    84.62%
Planner/PlanType.h                                 3                 1    66.67%           3                 1    66.67%           8                 4    50.00%           0                 0         -
Planner/Planner.cpp                               46                13    71.74%           7                 1    85.71%          63                12    80.95%          30                10    66.67%
Planner/plans/PhysicalMockTableScan.cpp           13                 5    61.54%           5                 1    80.00%          39                11    71.79%           8                 5    37.50%
Planner/plans/PhysicalTableScan.cpp               35                35     0.00%           7                 7     0.00%          50                50     0.00%          12                12     0.00%
Planner/tests/gtest_physical_plan.cpp            226               158    30.09%          10                 0   100.00%         171                 2    98.83%          44                38    13.64%
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                            681               344    49.49%          84                21    75.00%        1103               276    74.98%         344               160    53.49%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18470      9579             48.14%    207609  96144        53.69%

full coverage report (for internal network access only)

@SeaRise SeaRise force-pushed the new_support_table_scan branch from 304b8b8 to b256cfe Compare July 11, 2022 06:37
@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 11, 2022

/run-all-tests

@SeaRise SeaRise changed the title Planner: support table scan [WIP] Planner: support table scan Jul 11, 2022
@ti-chi-bot ti-chi-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 11, 2022
@ti-chi-bot ti-chi-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 11, 2022
@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 12, 2022

/rebuild

@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 12, 2022

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Jul 12, 2022

Coverage for changed files

Filename                                     Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Coprocessor/DAGQueryBlockInterpreter.cpp         255                90    64.71%          33                 5    84.85%         599               155    74.12%         162                60    62.96%
Coprocessor/GenSchemaAndColumn.cpp                12                 4    66.67%           3                 1    66.67%          41                15    63.41%          12                 5    58.33%
Coprocessor/PushDownFilter.cpp                    17                17     0.00%           5                 5     0.00%          39                39     0.00%          12                12     0.00%
Coprocessor/PushDownFilter.h                       1                 1     0.00%           1                 1     0.00%           1                 1     0.00%           0                 0         -
Planner/PhysicalPlan.cpp                          84                30    64.29%          11                 0   100.00%         132                24    81.82%          52                21    59.62%
Planner/PlanType.cpp                              14                 4    71.43%           1                 0   100.00%          31                 8    74.19%          26                 4    84.62%
Planner/PlanType.h                                 3                 1    66.67%           3                 1    66.67%           8                 4    50.00%           0                 0         -
Planner/Planner.cpp                               55                12    78.18%           8                 1    87.50%          73                 9    87.67%          40                12    70.00%
Planner/plans/PhysicalMockTableScan.cpp           13                 0   100.00%           5                 0   100.00%          39                 2    94.87%           8                 1    87.50%
Planner/plans/PhysicalTableScan.cpp               35                35     0.00%           7                 7     0.00%          53                53     0.00%          12                12     0.00%
Planner/tests/gtest_physical_plan.cpp            244               161    34.02%          10                 0   100.00%         171                 2    98.83%          50                41    18.00%
tests/gtest_planner_interpreter.cpp              230               114    50.43%           7                 0   100.00%         778                 0   100.00%          24                24     0.00%
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                            963               469    51.30%          94                21    77.66%        1965               312    84.12%         398               192    51.76%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18679      9506             49.11%    211157  95970        54.55%

full coverage report (for internal network access only)

@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 12, 2022

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Jul 12, 2022

Coverage for changed files

Filename                                     Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Coprocessor/DAGQueryBlockInterpreter.cpp         255                90    64.71%          33                 5    84.85%         599               155    74.12%         162                60    62.96%
Coprocessor/GenSchemaAndColumn.cpp                12                 4    66.67%           3                 1    66.67%          41                15    63.41%          12                 5    58.33%
Coprocessor/PushDownFilter.cpp                    16                16     0.00%           4                 4     0.00%          36                36     0.00%          12                12     0.00%
Coprocessor/PushDownFilter.h                       2                 2     0.00%           2                 2     0.00%           2                 2     0.00%           0                 0         -
Planner/PhysicalPlan.cpp                          84                30    64.29%          11                 0   100.00%         132                24    81.82%          52                21    59.62%
Planner/PlanType.cpp                              14                 4    71.43%           1                 0   100.00%          31                 8    74.19%          26                 4    84.62%
Planner/PlanType.h                                 3                 1    66.67%           3                 1    66.67%           8                 4    50.00%           0                 0         -
Planner/Planner.cpp                               55                12    78.18%           8                 1    87.50%          73                 9    87.67%          40                12    70.00%
Planner/plans/PhysicalMockTableScan.cpp           13                 0   100.00%           5                 0   100.00%          39                 2    94.87%           8                 1    87.50%
Planner/plans/PhysicalTableScan.cpp               35                35     0.00%           7                 7     0.00%          53                53     0.00%          12                12     0.00%
Planner/tests/gtest_physical_plan.cpp            244               161    34.02%          10                 0   100.00%         171                 2    98.83%          50                41    18.00%
tests/gtest_planner_interpreter.cpp              230               114    50.43%           7                 0   100.00%         778                 0   100.00%          24                24     0.00%
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                            963               469    51.30%          94                21    77.66%        1963               310    84.21%         398               192    51.76%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18679      9506             49.11%    211155  95939        54.56%

full coverage report (for internal network access only)

@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 13, 2022

/run-integration-test

2 similar comments
@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 13, 2022

/run-integration-test

@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 13, 2022

/run-integration-test

fix

fix

fix
@SeaRise SeaRise force-pushed the new_support_table_scan branch from 358ea4a to dd00e20 Compare July 13, 2022 16:01
@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 13, 2022

/run-integration-test

@SeaRise SeaRise changed the title [WIP] Planner: support table scan Planner: support table scan Jul 13, 2022
@SeaRise SeaRise removed the request for review from JaySon-Huang July 18, 2022 16:08
@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 18, 2022

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Jul 18, 2022

Coverage for changed files

Filename                                           Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Coprocessor/DAGQueryBlockInterpreter.cpp               255                85    66.67%          33                 5    84.85%         599               139    76.79%         162                56    65.43%
Coprocessor/GenSchemaAndColumn.cpp                      22                12    45.45%           5                 2    60.00%          61                28    54.10%          20                12    40.00%
Coprocessor/PushDownFilter.cpp                          16                16     0.00%           4                 4     0.00%          36                36     0.00%          12                12     0.00%
Coprocessor/PushDownFilter.h                             2                 2     0.00%           2                 2     0.00%           2                 2     0.00%           0                 0         -
Planner/PhysicalPlan.cpp                                88                31    64.77%          12                 0   100.00%         137                25    81.75%          54                22    59.26%
Planner/PlanType.cpp                                    14                 4    71.43%           1                 0   100.00%          31                 8    74.19%          26                 4    84.62%
Planner/PlanType.h                                       3                 1    66.67%           3                 1    66.67%           8                 4    50.00%           0                 0         -
Planner/Planner.cpp                                     56                12    78.57%           9                 1    88.89%          81                 9    88.89%          42                12    71.43%
Planner/plans/PhysicalMockExchangeReceiver.cpp          15                 0   100.00%           6                 0   100.00%          44                 3    93.18%          10                 1    90.00%
Planner/plans/PhysicalMockTableScan.cpp                 14                 0   100.00%           6                 0   100.00%          44                 3    93.18%           8                 1    87.50%
Planner/plans/PhysicalTableScan.cpp                     20                20     0.00%           7                 7     0.00%          57                57     0.00%           8                 8     0.00%
Planner/tests/gtest_physical_plan.cpp                  244               161    34.02%          10                 0   100.00%         171                 2    98.83%          50                41    18.00%
tests/gtest_planner_interpreter.cpp                    230               114    50.43%           7                 0   100.00%         778                 0   100.00%          24                24     0.00%
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                  979               458    53.22%         105                22    79.05%        2049               316    84.58%         416               193    53.61%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18772      9511             49.33%    214308  95978        55.21%

full coverage report (for internal network access only)

@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 19, 2022

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Jul 19, 2022

Coverage for changed files

Filename                                           Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Coprocessor/DAGQueryBlockInterpreter.cpp               255                85    66.67%          33                 5    84.85%         599               139    76.79%         162                56    65.43%
Coprocessor/GenSchemaAndColumn.cpp                      22                12    45.45%           5                 2    60.00%          61                28    54.10%          20                12    40.00%
Coprocessor/PushDownFilter.cpp                          16                16     0.00%           4                 4     0.00%          36                36     0.00%          12                12     0.00%
Coprocessor/PushDownFilter.h                             2                 2     0.00%           2                 2     0.00%           2                 2     0.00%           0                 0         -
Planner/PhysicalPlan.cpp                                88                31    64.77%          12                 0   100.00%         137                25    81.75%          54                22    59.26%
Planner/PlanType.cpp                                    14                 4    71.43%           1                 0   100.00%          31                 8    74.19%          26                 4    84.62%
Planner/PlanType.h                                       3                 1    66.67%           3                 1    66.67%           8                 4    50.00%           0                 0         -
Planner/Planner.cpp                                     56                12    78.57%           9                 1    88.89%          81                 9    88.89%          42                12    71.43%
Planner/plans/PhysicalMockExchangeReceiver.cpp          15                 0   100.00%           6                 0   100.00%          44                 3    93.18%          10                 1    90.00%
Planner/plans/PhysicalMockTableScan.cpp                 14                 0   100.00%           6                 0   100.00%          44                 3    93.18%           8                 1    87.50%
Planner/plans/PhysicalTableScan.cpp                     20                20     0.00%           7                 7     0.00%          57                57     0.00%           8                 8     0.00%
Planner/tests/gtest_physical_plan.cpp                  244               161    34.02%          10                 0   100.00%         171                 2    98.83%          50                41    18.00%
tests/gtest_planner_interpreter.cpp                    230               114    50.43%           7                 0   100.00%         778                 0   100.00%          24                24     0.00%
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                  979               458    53.22%         105                22    79.05%        2049               316    84.58%         416               193    53.61%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18772      9515             49.31%    214308  96017        55.20%

full coverage report (for internal network access only)

@SeaRise SeaRise requested a review from JaySon-Huang July 20, 2022 02:31
@SeaRise SeaRise requested a review from gengliqi July 25, 2022 01:33
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 25, 2022
Copy link
Contributor

@ywqzzy ywqzzy 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 status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jul 25, 2022
@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 25, 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: 8d49b57

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 25, 2022
@ti-chi-bot
Copy link
Member

@SeaRise: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

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.

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.

@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 25, 2022

/run-all-tests

@SeaRise
Copy link
Contributor Author

SeaRise commented Jul 25, 2022

/run-integration-test

@sre-bot
Copy link
Collaborator

sre-bot commented Jul 25, 2022

Coverage for changed files

Filename                                                 Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Flash/Coprocessor/DAGQueryBlockInterpreter.cpp               255                83    67.45%          33                 5    84.85%         601               134    77.70%         162                54    66.67%
Flash/Coprocessor/GenSchemaAndColumn.cpp                      18                10    44.44%           4                 2    50.00%          50                27    46.00%          18                11    38.89%
Flash/Coprocessor/PushDownFilter.cpp                          16                16     0.00%           4                 4     0.00%          36                36     0.00%          12                12     0.00%
Flash/Coprocessor/PushDownFilter.h                             2                 2     0.00%           2                 2     0.00%           2                 2     0.00%           0                 0         -
Flash/Planner/PhysicalPlan.cpp                                88                31    64.77%          12                 0   100.00%         137                25    81.75%          54                22    59.26%
Flash/Planner/PlanType.cpp                                    14                 4    71.43%           1                 0   100.00%          31                 8    74.19%          26                 4    84.62%
Flash/Planner/PlanType.h                                       3                 1    66.67%           3                 1    66.67%           8                 4    50.00%           0                 0         -
Flash/Planner/Planner.cpp                                     56                12    78.57%           9                 1    88.89%          81                 9    88.89%          42                12    71.43%
Flash/Planner/plans/PhysicalMockExchangeReceiver.cpp          15                 0   100.00%           6                 0   100.00%          44                 3    93.18%          10                 1    90.00%
Flash/Planner/plans/PhysicalMockTableScan.cpp                 14                 0   100.00%           6                 0   100.00%          44                 3    93.18%           8                 1    87.50%
Flash/Planner/plans/PhysicalTableScan.cpp                     20                20     0.00%           7                 7     0.00%          57                57     0.00%           8                 8     0.00%
Flash/Planner/tests/gtest_physical_plan.cpp                  244               161    34.02%          10                 0   100.00%         171                 2    98.83%          50                41    18.00%
Flash/tests/gtest_planner_interpreter.cpp                    230               114    50.43%           7                 0   100.00%         778                 0   100.00%          24                24     0.00%
Storages/Transaction/TiDB.cpp                                508               280    44.88%          48                13    72.92%         901               407    54.83%         352               154    56.25%
Storages/Transaction/TiDB.h                                   20                 7    65.00%          16                 3    81.25%          16                 3    81.25%           6                 6     0.00%
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                       1503               741    50.70%         168                38    77.38%        2957               720    75.65%         772               350    54.66%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18948      9482             49.96%    216171  95837        55.67%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit 42b4055 into pingcap:planner_refactory Jul 25, 2022
@SeaRise SeaRise deleted the new_support_table_scan branch December 24, 2022 04:12
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