-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
execution: support explain analyze in mpp execution. #22053
Conversation
Please follow PR Title Format:
Or if the count of mainly changed packages are more than 3, use
|
/run-all-tests |
util/execdetails/execdetails_test.go
Outdated
if stats.GetCopStats(aggID).String() != "tikv_task:{proc max:4ns, min:3ns, p80:4ns, p95:4ns, iters:7, tasks:2}" { | ||
t.Fatal("agg") | ||
if stats.GetCopStats(aggID).String() != "tikv_task:{proc max:4ns, min:3ns, p80:4ns, p95:4ns, iters:7, tasks:2, concurrency:2}" { | ||
t.Fatalf("agg cop stats string is not expect, got: %v", stats.GetCopStats(aggID).String()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more common way is "as expected"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-tics-test |
executor/explainfor_test.go
Outdated
@@ -112,7 +112,7 @@ func (s *testSerialSuite) TestExplainFor(c *C) { | |||
} | |||
c.Assert(buf.String(), Matches, ""+ | |||
"TableReader_5 10000.00 0 root time:.*, loops:1, cop_task: {num:.*, max:.*, proc_keys: 0, rpc_num: 1, rpc_time:.*} data:TableFullScan_4 N/A N/A\n"+ | |||
"└─TableFullScan_4 10000.00 0 cop.* table:t1 tikv_task:{time:.*, loops:0}, scan_detail:.* keep order:false, stats:pseudo N/A N/A") | |||
"└─TableFullScan_4 10000.00 0 cop.* table:t1 tikv_task:{time:.*, loops:0, concurrency:1}, scan_detail:.* keep order:false, stats:pseudo N/A N/A") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tikv_task?
should tikv tasks show concurrency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, every TiKV task has concurrency 1, I think it is at least harmless to show it for TiKV tasks, user can just ignore it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should ask the related PM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think keeping tikv's result still is better. No changes is better than harmless changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For TiKV, I will print threads:N/A
instead
/run-all-tests |
return &tipb.ExecutorExecutionSummary{TimeProcessedNs: &TimeProcessedNs, NumProducedRows: &NumProducedRows, | ||
NumIterations: &NumIterations, ExecutorId: &ExecutorID, XXX_unrecognized: nil} | ||
NumIterations: &NumIterations, Concurrency: &Concurrency, ExecutorId: &ExecutorID, XXX_unrecognized: nil} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why here show concurrency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For single cop/mpp task, this field is the running concurrency of the executor.
consume: int64(*summary.TimeProcessedNs), | ||
rows: int64(*summary.NumProducedRows)}) | ||
rows: int64(*summary.NumProducedRows)}, | ||
threads: int32(summary.GetConcurrency()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getConcurrency() -> getThreads()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getConcurrency
is a method generated by protobuf
for backoff := range bo.backoffTimes { | ||
backoffName := backoff.String() | ||
resp.detail.BackoffTimes[backoffName] = bo.backoffTimes[backoff] | ||
resp.detail.BackoffSleep[backoffName] = time.Duration(bo.backoffSleepMS[backoff]) * time.Millisecond |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why *
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because time.Duration(bo.backoffSleepMS[backoff])
is Nanosecond based.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/LGTM |
/merge |
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
@windtalker merge failed. |
/run-e2e-test |
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests |
/run-unit-test |
/merge |
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
What problem does this PR solve?
Issue Number: close pingcap/tiflash#1288
Problem Summary:
Currently, explain analyze does not show cop executor's execution summaries when in mpp execution mode
What is changed and how it works?
Proposal: xxx
What's Changed:
How it Works:
Collect cop executor execution summaries in mpp mode.
Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Side effects
Release note