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 documentation on EXPLAIN and EXPLAIN ANALYZE #12122

Merged
merged 17 commits into from
Aug 28, 2024

Conversation

devanbenz
Copy link
Contributor

@devanbenz devanbenz commented Aug 22, 2024

Which issue does this PR close?

Closes #12088

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Aug 22, 2024
overlaps. This is the case of this example.
2. Split the non-overlaps to increase parallel execution

##### When we know there are ovelaps?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alamb can overlaps happen in normal datafusion query plans? Or is this specific to InfluxDB? If possible could you point me in the direction of getting a parquet data-set with overlaps so I can run the EXPLAIN's locally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually taking a look at the datafusion docs I'm not seeing DeduplicateExec in the public crate docs so I'm assuming this is not valid for core datafusion.
https://docs.rs/datafusion/latest/datafusion/physical_plan/union/struct.UnionExec.html?search=DeduplicateExec

@alamb alamb changed the title feat(wip): working on adding explain docs WIP: add documentation on EXPLAIN PLAN Aug 23, 2024
@alamb
Copy link
Contributor

alamb commented Aug 23, 2024

This is awesome -- thank you @devanbenz

I took the liberty of pushing some commits to the branch that updated the first example and some wording -- let me know what you think. Maybe you could apply some of changes to the rest of the writeup too

I will try and find some more time later today or over the weekend to improve this documentation further with you.

@alamb
Copy link
Contributor

alamb commented Aug 23, 2024

I am going to try and document the analyze portion as well


##### Query and query plan

TODO: devanbenz can you update this section, trying to follow the model of the simpler one above?
Copy link
Contributor

Choose a reason for hiding this comment

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

@devanbenz -- this is so cool. Thank you for getting the ball rolling.

I wonder if you might be willing to try and take a shot at filling in this section for

SELECT "UserID", COUNT(*) FROM 'hits.parquet' GROUP BY "UserID" ORDER BY COUNT(*) DESC LIMIT 10;

?

The examples from our influx docs didn't translate very well to hits.parquet -- I apologize for not realizing that sooner

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That sounds good to me! I'll have some time over the weekend to tackle it :)

@devanbenz devanbenz requested a review from alamb August 25, 2024 15:21
@devanbenz
Copy link
Contributor Author

@alamb Please let me know if theres anything else you would like for me to elaborate on within the aggregate plan. Taking a look at the original issue section I was seeing: #12088 (comment) which added some insight on exchange-based parallelism. Would you like for me to elaborate more on this?

@alamb alamb changed the title WIP: add documentation on EXPLAIN PLAN Add documentation on EXPLAIN PLAN Aug 26, 2024
@alamb alamb marked this pull request as ready for review August 26, 2024 21:11
@alamb
Copy link
Contributor

alamb commented Aug 26, 2024

@alamb Please let me know if theres anything else you would like for me to elaborate on within the aggregate plan. Taking a look at the original issue section I was seeing: #12088 (comment) which added some insight on exchange-based parallelism. Would you like for me to elaborate more on this?

Thank you @devanbenz -- this is great 🙏

I pushed some more clarifications but really a wonderful job explaining / linking.

@alamb alamb changed the title Add documentation on EXPLAIN PLAN Add documentation on EXPLAIN and EXPLAIN ANALYZE Aug 26, 2024
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @devanbenz -- this is really great.

I pushed another commit with some additional detail but this was a great job. Super helpful to get this going. Good teamwork! ✋

cc @NGA-TRAN @jstirnaman and @2010YOUY01

@alamb alamb merged commit 7d8bb0b into apache:main Aug 28, 2024
7 checks passed
@alamb
Copy link
Contributor

alamb commented Aug 28, 2024

I think this is a great start and we can continue to iterate on the documentation as follow on PRs

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document "how to read an explain plan"
2 participants