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: add runtime information for point-get executor (#18666) #18817

Merged
merged 11 commits into from
Jul 31, 2020

Conversation

ti-srebot
Copy link
Contributor

cherry-pick #18666 to release-4.0


What problem does this PR solve?

As the title said.

Here is some example of explain analyze select * from t where a=1;

Normally

+-------------+---------+---------+------+------------------------+----------------------------------------------------------+---------------+--------+------+
| id          | estRows | actRows | task | access object          | execution info                                           | operator info | memory | disk |
+-------------+---------+---------+------+------------------------+----------------------------------------------------------+---------------+--------+------+
| Point_Get_1 | 1.00    | 1       | root | table:t, index:idx1(a) | time:699.459µs, loops:2, Get_rpc:{num:2, time:662.459µs} |               | N/A    | N/A  |
+-------------+---------+---------+------+------------------------+----------------------------------------------------------+---------------+--------+------+

when point-get meet lock:

+-------------+---------+---------+------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+---------------+--------+------+
| id          | estRows | actRows | task | access object          | execution info                                                                                                                                    | operator info | memory | disk |
+-------------+---------+---------+------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+---------------+--------+------+
| Point_Get_1 | 1.00    | 1       | root | table:t, index:idx1(a) | time:4.520115944s, loops:2, Get_rpc:{num:3, time:666.149µs},ResolveLock_rpc:{num:1, time:4.519421685s},txnNotFound_backoff:{num:16, time:4510 ms} |               | N/A    | N/A  |
+-------------+---------+---------+------+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+---------------+--------+------+

when tikv restart:

+-------------+---------+---------+------+------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+---------------+--------+------+
| id          | estRows | actRows | task | access object          | execution info                                                                                                                                  | operator info | memory | disk |
+-------------+---------+---------+------+------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+---------------+--------+------+
| Point_Get_1 | 1.00    | 1       | root | table:t, index:idx1(a) | time:9.051671089s, loops:2, Get_rpc:{num:11, time:8.020006147s},tikvRPC_backoff:{num:9, time:7998 ms},regionMiss_backoff:{num:10, time:1012 ms} |               | N/A    | N/A  |
+-------------+---------+---------+------+------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+---------------+--------+------+

Of course, the slow-log will also record the point-get runtime information too:

select plan from information_schema.`SLOW_QUERY` where time > "2020-07-17 14:20:00" and query like "select% t%" order by query_time desc limit 1\G
***************************[ 1. row ]***************************
plan |  id              task    estRows operator info           actRows execution info                                                                                                                                  memory  disk
        Point_Get_1     root    1       table:t, index:idx1(a)  1       time:5.233083269s, loops:2, Get_rpc:{num:9, time:4.957755414s},regionMiss_backoff:{num:8, time:256 ms},tikvRPC_backoff:{num:7, time:4944 ms}    N/A     N/A

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Side effects

  • Performance regression
    • Consumes more CPU

Release note

  • Add executor runtime information for point-get.

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor Author

/run-all-tests

executor/executor.go Outdated Show resolved Hide resolved
@imtbkcat imtbkcat modified the milestones: v4.0.4, v4.0.5 Jul 28, 2020
@crazycs520
Copy link
Contributor

/run-all-tests

@crazycs520
Copy link
Contributor

/run-all-tests

Copy link
Contributor

@qw4990 qw4990 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 Jul 31, 2020
@qw4990
Copy link
Contributor

qw4990 commented Jul 31, 2020

/run-all-tests

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

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 31, 2020
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot
Copy link
Contributor Author

@ti-srebot merge failed.

@SunRunAway SunRunAway merged commit 9b26b78 into pingcap:release-4.0 Jul 31, 2020
@SunRunAway SunRunAway deleted the release-4.0-8b19d67bad6d branch July 31, 2020 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants