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

*: Refine execution summary with ExecutorStatisticsCollector #6995

Merged
merged 27 commits into from
Mar 21, 2023

Conversation

ywqzzy
Copy link
Contributor

@ywqzzy ywqzzy commented Mar 8, 2023

What problem does this PR solve?

Issue Number: ref #5900 #6518

Problem Summary:

What is changed and how it works?

In previous implementation, ExecutionSummaryCollector traverse through all profilingStreams to collect local execution info.
While the ExecutorsStatisticsCollector do the same job for mpp tracing.
As a result, we can use ExecutorsStatisticsCollector to collect local execution info instead.

The change contains:

  1. use ExecutorsStatisticsCollector to fill execution summary.
  2. allow ExecutorsStatisticsCollector to collect profile for list based executors and cop tasks.
  3. Refine JoinImpl to add join build time.
  4. add more tests for list-based executor (from tispark) and tree-based executor (from tidb), add test for execution summary with planner and QueryBlockInterpreter.
  5. fwd declare some DAGContext to make the compile faster.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
use test;
create table t(a int);
alter table t set tiflash replica 1;
insert into t values(1),(2),(3),(4);
create table t2(a int);
insert into t2 values(1),(2);
alter table t2 set tiflash replica 1;

set tidb_enforce_mpp=true;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;

explain analyze select * from t, t2;
explain analyze select * from t;
explain analyze select count(a) from t group by a;
explain analyze select count(a) from t;
explain analyze select * from t, t2 where t.a = t2.a;
  • 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 Mar 8, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • SeaRise
  • yibin87

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 do-not-merge/needs-linked-issue do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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. labels Mar 8, 2023
@ywqzzy ywqzzy changed the title [WIP]: Refine execution summary with ExecutorStatisticsCollector *: Refine execution summary with ExecutorStatisticsCollector Mar 9, 2023
@ti-chi-bot ti-chi-bot removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-linked-issue labels Mar 9, 2023
@ywqzzy ywqzzy mentioned this pull request Mar 9, 2023
25 tasks
dbms/src/Flash/Coprocessor/DAGContext.h Outdated Show resolved Hide resolved
dbms/src/Flash/Statistics/ExchangeReceiverImpl.h Outdated Show resolved Hide resolved
dbms/src/Flash/Planner/ExecutorIdGenerator.h Outdated Show resolved Hide resolved
Comment on lines 53 to 56
/// In TiFlash, a hash join's build side is finished before probe side starts,
/// so the join probe side's running time does not include hash table's build time,
/// when construct ExecutionSummaries, we need add the build cost to probe executor
base.execution_time_ns += join_build_base.execution_time_ns;
Copy link
Contributor

Choose a reason for hiding this comment

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

This treatment is wrong
From https://github.com/pingcap/tiflash/pull/6995/files#diff-8afda9cf273246b0b526e551688e59abad0ac41f2803a82e1342eb15bf1c1a4bL88-L109, here also need to add the execute time of all join build streams that executed before.

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 11, 2023
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 13, 2023
@ywqzzy ywqzzy force-pushed the refine_execution_summary branch from b7762e6 to 070f3aa Compare March 21, 2023 06:09
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Mar 21, 2023

/run-all-tests

@ywqzzy ywqzzy requested review from yibin87 and SeaRise March 21, 2023 06:16
Copy link
Contributor

@SeaRise SeaRise left a comment

Choose a reason for hiding this comment

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

Others LGTM

dbms/src/Flash/Statistics/ExecutorStatisticsCollector.h Outdated Show resolved Hide resolved
dbms/src/Flash/Coprocessor/ExecutionSummary.cpp Outdated Show resolved Hide resolved
@ywqzzy ywqzzy requested a review from SeaRise March 21, 2023 06:44
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 21, 2023
Copy link
Contributor

@SeaRise SeaRise left a comment

Choose a reason for hiding this comment

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

lgtm

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Mar 21, 2023

/run-all-tests

Copy link
Contributor

@yibin87 yibin87 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 Mar 21, 2023
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Mar 21, 2023

/merge

@ti-chi-bot
Copy link
Member

@ywqzzy: 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: dfa1d0a

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 21, 2023
@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Mar 21, 2023
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Mar 21, 2023

/merge

@ti-chi-bot
Copy link
Member

@ywqzzy: 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: 05ebf5a

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 21, 2023
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Mar 21, 2023

/run-unit-tests

@ti-chi-bot
Copy link
Member

@ywqzzy: 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

trigger some heavy tests which will not run always when PR updated.

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.

@ti-chi-bot ti-chi-bot merged commit 91f4896 into pingcap:master Mar 21, 2023
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.

5 participants