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

feat: support distributed EXPLAIN ANALYZE #3908

Merged
merged 7 commits into from
May 10, 2024

Conversation

waynexia
Copy link
Member

@waynexia waynexia commented May 10, 2024

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

What's changed and what's your intention?

Now EXPLAIN ANALYZE will work correctly under distributed mode. The format follows discussion here #2374 (comment)

See tests/cases/distributed/explain/analyze.result for the example. Or here is one from my env:

explain analyze SELECT count(*) FROM system_metrics;

+-------+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| stage | node | plan                                                                                                                                                                            |
+-------+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 0     | 0    |  MergeScanExec: peers=[4402341478400(1025, 0), ] metrics=[output_rows: 1, greptime_exec_read_cost: 0, ready_time: 6352264, finish_time: 7509279, first_consume_time: 7165836, ] |
|       |      |                                                                                                                                                                                 |
| 1     | 0    |  AggregateExec: mode=Final, gby=[], aggr=[COUNT(greptime.public.system_metrics.ts)] metrics=[output_rows: 1, elapsed_compute: 108029, ]                                         |
|       |      |   CoalescePartitionsExec metrics=[output_rows: 32, elapsed_compute: 83055, ]                                                                                                    |
|       |      |     AggregateExec: mode=Partial, gby=[], aggr=[COUNT(greptime.public.system_metrics.ts)] metrics=[output_rows: 32, elapsed_compute: 334913, ]                                   |
|       |      |       RepartitionExec: partitioning=RoundRobinBatch(32), input_partitions=1 metrics=[repart_time: 1, fetch_time: 441565, send_time: 30325, ]                                    |
|       |      |         StreamScanAdapter { stream: "<SendableRecordBatchStream>" } metrics=[output_rows: 3, mem_used: 24, ]                                                                    |
|       |      |                                                                                                                                                                                 |
|       |      | Total rows: 1                                                                                                                                                                   |
+-------+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR does not require documentation updates.

waynexia added 4 commits May 9, 2024 17:26
Signed-off-by: Ruihang Xia <[email protected]>
Signed-off-by: Ruihang Xia <[email protected]>
Signed-off-by: Ruihang Xia <[email protected]>
@waynexia waynexia requested review from evenyag and a team as code owners May 10, 2024 11:36
@github-actions github-actions bot added the docs-not-required This change does not impact docs. label May 10, 2024
@waynexia waynexia requested a review from shuiyisong May 10, 2024 11:37
Signed-off-by: Ruihang Xia <[email protected]>
Copy link
Contributor

@evenyag evenyag left a comment

Choose a reason for hiding this comment

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

Feels good to me. Exquisite design

src/common/recordbatch/src/adapter.rs Outdated Show resolved Hide resolved
src/common/recordbatch/src/adapter.rs Show resolved Hide resolved
Copy link

codecov bot commented May 10, 2024

Codecov Report

Attention: Patch coverage is 23.11558% with 153 lines in your changes are missing coverage. Please review.

Project coverage is 85.65%. Comparing base (7de62ef) to head (37d6bbd).
Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3908      +/-   ##
==========================================
+ Coverage   85.62%   85.65%   +0.02%     
==========================================
  Files         952      961       +9     
  Lines      163611   164539     +928     
==========================================
+ Hits       140093   140934     +841     
- Misses      23518    23605      +87     

Signed-off-by: Ruihang Xia <[email protected]>
@waynexia waynexia enabled auto-merge May 10, 2024 12:00
Copy link
Collaborator

@fengjiachun fengjiachun left a comment

Choose a reason for hiding this comment

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

LGTM

src/query/src/analyze.rs Outdated Show resolved Hide resolved
@waynexia waynexia added this pull request to the merge queue May 10, 2024
Merged via the queue into GreptimeTeam:main with commit aec5cca May 10, 2024
23 checks passed
@waynexia waynexia deleted the dist-analyze branch May 10, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required This change does not impact docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants