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: show operators' disk consumption in results of EXPLAIN ANALYZE #13764

Merged
merged 8 commits into from
Dec 2, 2019

Conversation

Reminiscent
Copy link
Contributor

@Reminiscent Reminiscent commented Nov 27, 2019

What problem does this PR solve?

Close #12625
Add a new column named disk in the results of EXPLAIN ANALYZE to display memory consumption of operators.

After this PR, you can see:

mysql> explain analyze select avg(t1.a) from t1, t2 where t1.b = t2.b group by t1.a;
+------------------------------+-------+-----------+------------------------------------------------------------------+--------------------------------------------------------------+-------------+-----------+
| id                           | count | task      | operator info                                                    | execution info                                               | memory      | disk      |
+------------------------------+-------+-----------+------------------------------------------------------------------+--------------------------------------------------------------+-------------+-----------+
| HashAgg_11                   | 7.19  | root      | group by:Column#9, funcs:avg(Column#8)                           | time:1.409344ms, loops:2, rows:3                             | N/A         | N/A       |
| └─Projection_20              | 11.24 | root      | cast(Column#1), Column#1                                         | time:824.972µs, loops:2, rows:27                             | N/A         | N/A       |
|   └─HashLeftJoin_12          | 11.24 | root      | inner join, inner:TableReader_19, equal:[eq(Column#2, Column#5)] | time:774.511µs, loops:2, rows:27                             | 8.234375 KB | 144 Bytes |
|     ├─TableReader_16         | 8.99  | root      | data:Selection_15                                                | time:384.076µs, loops:2, rows:9, rpc num:1, time:911.419µs   | 284 Bytes   | N/A       |
|     │ └─Selection_15         | 8.99  | cop[tikv] | not(isnull(Column#2))                                            | time:234.589µs, loops:10, rows:9                             | N/A         | N/A       |
|     │   └─TableScan_14       | 9.00  | cop[tikv] | table:t1, range:[-inf,+inf], keep order:false, stats:pseudo      | time:216.418µs, loops:10, rows:9                             | N/A         | N/A       |
|     └─TableReader_19         | 8.99  | root      | data:Selection_18                                                | time:281.396µs, loops:2, rows:9, rpc num:1, time:385.191µs   | 201 Bytes   | N/A       |
|       └─Selection_18         | 8.99  | cop[tikv] | not(isnull(Column#5))                                            | time:205.323µs, loops:10, rows:9                             | N/A         | N/A       |
|         └─TableScan_17       | 9.00  | cop[tikv] | table:t2, range:[-inf,+inf], keep order:false, stats:pseudo      | time:189.869µs, loops:10, rows:9                             | N/A         | N/A       |
+------------------------------+-------+-----------+------------------------------------------------------------------+--------------------------------------------------------------+-------------+-----------+
9 rows in set (0.01 sec)

What is changed and how it works?

Check List

Tests

  • Unit test

@Reminiscent Reminiscent changed the title [WIP] executor: show operators' memory consumption in results of EXPLAIN ANALYZE [WIP] executor: show operators disk consumption in results of EXPLAIN ANALYZE Nov 27, 2019
@Reminiscent Reminiscent changed the title [WIP] executor: show operators disk consumption in results of EXPLAIN ANALYZE [WIP] executor: show operators' disk consumption in results of EXPLAIN ANALYZE Nov 27, 2019
@Reminiscent
Copy link
Contributor Author

/run-unit-test

@codecov
Copy link

codecov bot commented Nov 27, 2019

Codecov Report

Merging #13764 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #13764   +/-   ##
===========================================
  Coverage   80.3169%   80.3169%           
===========================================
  Files           474        474           
  Lines        118264     118264           
===========================================
  Hits          94986      94986           
  Misses        15847      15847           
  Partials       7431       7431

@Reminiscent Reminiscent changed the title [WIP] executor: show operators' disk consumption in results of EXPLAIN ANALYZE executor: show operators' disk consumption in results of EXPLAIN ANALYZE Nov 27, 2019
@Reminiscent
Copy link
Contributor Author

/run-all-tests

@Reminiscent
Copy link
Contributor Author

/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

@SunRunAway SunRunAway added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 2, 2019
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

@qw4990 qw4990 added status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Dec 2, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Dec 2, 2019

/run-all-tests

@sre-bot sre-bot merged commit 8fab254 into pingcap:master Dec 2, 2019
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

show disk usage information in explain analyze
4 participants