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

executor: fix issue of explain for connection can't show the last query plan #21242

Merged
merged 23 commits into from
Nov 26, 2020

Conversation

crazycs520
Copy link
Contributor

@crazycs520 crazycs520 commented Nov 24, 2020

What problem does this PR solve?

close #21235

This bug is imported by #19296.

As the title said, here is an example:

test> select connection_id();
+---------------------+
| connection_id()     |
+---------------------+
| 5235610488678645763 |
+---------------------+
1 row in set
Time: 0.011s
test> select * from t where a=1;
+---+---+
| a | b |
+---+---+
| 1 | 1 |
+---+---+
1 row in set
Time: 0.012s
test> explain for connection 5235610488678645763;
+-------------+---------+---------+------+---------------+----------------------------------------------------------------+---------------+--------+------+
| id          | estRows | actRows | task | access object | execution info                                                 | operator info | memory | disk |
+-------------+---------+---------+------+---------------+----------------------------------------------------------------+---------------+--------+------+
| Point_Get_1 | 1.00    | 1       | root | table:t       | time:884.141µs, loops:2, Get:{num_rpc:1, total_time:510.211µs} | handle:1      | N/A    | N/A  |
+-------------+---------+---------+------+---------------+----------------------------------------------------------------+---------------+--------+------+

What is changed and how it works?

  1. Keep saving last valid plan when the connection is sleeping.

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test

Side effects

  • Performance regression
    • Consumes more CPU
    • Consumes more MEM

Release note

  • fix issue of explain for connection can't show the last query plan/

Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
@crazycs520 crazycs520 requested review from a team as code owners November 24, 2020 06:25
@crazycs520 crazycs520 requested review from qw4990 and lzmhhh123 and removed request for a team November 24, 2020 06:25
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
@jebter jebter modified the milestone: v4.0.9 Nov 24, 2020
Signed-off-by: crazycs520 <crazycs520@gmail.com>
@crazycs520
Copy link
Contributor Author

/run-all-tests

@crazycs520
Copy link
Contributor Author

@SunRunAway @qw4990 PTAL

@ichn-hu ichn-hu mentioned this pull request Nov 24, 2020
Copy link
Contributor

@SunRunAway SunRunAway 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-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 24, 2020
Copy link
Contributor

@AilinKid AilinKid 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-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Nov 24, 2020
ti-srebot
ti-srebot previously approved these changes Nov 24, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Nov 24, 2020
@crazycs520
Copy link
Contributor Author

/merge

@crazycs520
Copy link
Contributor Author

/merge

@ti-srebot
Copy link
Contributor

Your auto merge job has been accepted, waiting for:

  • 21052

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@crazycs520 merge failed.

@crazycs520
Copy link
Contributor Author

/build

@crazycs520
Copy link
Contributor Author

/run-unit-test

Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
@crazycs520
Copy link
Contributor Author

/run-all-tests

@crazycs520
Copy link
Contributor Author

/run-all-tests

@crazycs520
Copy link
Contributor Author

/run-all-tests

@crazycs520
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

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

LGTM

@AilinKid
Copy link
Contributor

/run-all-tests

@crazycs520 crazycs520 merged commit ab9ddcc into pingcap:master Nov 26, 2020
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Nov 26, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #21315

ti-srebot added a commit that referenced this pull request Nov 26, 2020
…ry plan (#21242) (#21315)

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

explain for connection shows incorrect empty result
5 participants