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 the indexlookup runtime stats infomation (#20145) #20695

Merged
merged 5 commits into from
Oct 30, 2020

Conversation

ti-srebot
Copy link
Contributor

cherry-pick #20145 to release-4.0


Signed-off-by: jyz0309 45495947@qq.com

What problem does this PR solve?

Issue Number: close #19349, close #20323

Problem Summary:Currently, the runtime stats of IndexLookUp is hard to understand
After this pr:

mysql> explain analyze select * from t use index(a) where a > 1;
+-------------------------------+---------+---------+-----------+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------+--------------+------+
| id                            | estRows | actRows | task      | access object       | execution info                                                                                                                                                         | operator info                                  | memory       | disk |
+-------------------------------+---------+---------+-----------+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------+--------------+------+
| IndexLookUp_7                 | 1.00    | 2       | root      |                     | time:2.102174ms, loops:2, index_task:868.167µs, table_task:{num:1, concurrency:5, time:5.210409ms}                                                                     |                                                | 8.7578125 KB | N/A  |
| ├─IndexRangeScan_5(Build)     | 1.00    | 2       | cop[tikv] | table:t, index:a(a) | time:873.8µs, loops:1, cop_task: {num: 1, max:754.356µs, proc_keys: 2, rpc_num: 1, rpc_time: 698.426µs, copr_cache_hit_ratio: 0.00}, tikv_task:{time:0s, loops:1}      | range:(1,+inf], keep order:false, stats:pseudo | N/A          | N/A  |
| └─TableRowIDScan_6(Probe)     | 1.00    | 2       | cop[tikv] | table:t             | time:619.809µs, loops:2, cop_task: {num: 1, max:540.214µs, proc_keys: 2, rpc_num: 1, rpc_time: 510.336µs, copr_cache_hit_ratio: 0.00}, tikv_task:{time:0s, loops:1}    | keep order:false, stats:pseudo                 | N/A          | N/A  |
+-------------------------------+---------+---------+-----------+---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------+--------------+------+
3 rows in set (0.00 sec)

What is changed and how it works?

How it Works:

  • add the indexlookup runtime stats to get the runstat infomation
  • optimze the explain analyze execution info,make the copStat and rootStat output together

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

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

Side effects

  • Performance regression
    • Consumes more CPU
    • Consumes more MEM

Release note

  • add the indexlookup runtime stats infomation

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

/run-all-tests

Signed-off-by: jyz0309 <45495947@qq.com>
Signed-off-by: jyz0309 <45495947@qq.com>
@jyz0309
Copy link
Contributor

jyz0309 commented Oct 29, 2020

/run-all-tests

Signed-off-by: jyz0309 <45495947@qq.com>
Copy link
Contributor

@crazycs520 crazycs520 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 Oct 29, 2020
@crazycs520
Copy link
Contributor

@qw4990 PTAL

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 status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Oct 30, 2020
@qw4990
Copy link
Contributor

qw4990 commented Oct 30, 2020

/run-all-tests

@qw4990
Copy link
Contributor

qw4990 commented Oct 30, 2020

/run-all-tests

1 similar comment
@qw4990
Copy link
Contributor

qw4990 commented Oct 30, 2020

/run-all-tests

@crazycs520
Copy link
Contributor

/merge

@ti-srebot
Copy link
Contributor Author

Sorry @crazycs520, you don't have permission to trigger auto merge event on this branch.

@qw4990 qw4990 merged commit e069732 into pingcap:release-4.0 Oct 30, 2020
@crazycs520 crazycs520 removed this from the v4.0.8 milestone Oct 30, 2020
@crazycs520 crazycs520 added this to the v4.0.9 milestone Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants