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: Enhance explain #146

Merged
merged 2 commits into from
Dec 8, 2024
Merged

Conversation

kysshsy
Copy link
Contributor

@kysshsy kysshsy commented Oct 7, 2024

Ticket(s) Closed

What

Why

How

Support the ANALYZE option: add a timer to record the actual execution time.
Support the STYLE option: Provide the query plan and execution time in DuckDB style.

Tests

@kysshsy
Copy link
Contributor Author

kysshsy commented Oct 7, 2024

It depends on sqlparser apache/datafusion-sqlparser-rs#1426. Awaiting the next release of the library.

src/hooks/query.rs Outdated Show resolved Hide resolved
@philippemnoel
Copy link
Collaborator

Should this be based off of #140?

@kysshsy
Copy link
Contributor Author

kysshsy commented Oct 9, 2024

Should this be based off of #140?

:) It actually doesn’t depend on #140; it’s just that part of them are the same. (split the explain in a single file.)

@philippemnoel
Copy link
Collaborator

Should this be based off of #140?

:) It actually doesn’t depend on #140; it’s just that part of them are the same. (split the explain in a single file.)

Got it. Let's still get the PREPARE PR in first though, since this one is blocked. Thank YOU for doing this, your PRs are always so clean!

Copy link
Collaborator

@philippemnoel philippemnoel left a comment

Choose a reason for hiding this comment

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

Could you please provide output examples for all the style/options you are adding here? I.e. what the query looks like, and what the output looks like? I'd like to build a better understanding of what this will look like before we merge anything.

Also some tests, but I understand this PR isn't ready for review yet.

@kysshsy
Copy link
Contributor Author

kysshsy commented Oct 13, 2024

image image

Now supports :

  1. analyze (add a execution time statistics)
  2. duckdb style
  3. duckdb style and analyze

We can consider whether we need to add this style option.
The output of the EXPLAIN command in DuckDB differs significantly from that of PostgreSQL. Therefore, I would like to introduce a style option that allows users to obtain more detailed information about the query plan and performance tuning.

@philippemnoel
Copy link
Collaborator

image image
Now supports :

  1. analyze (add a execution time statistics)
  2. duckdb style
  3. duckdb style and analyze

We can consider whether we need to add this style option. The output of the EXPLAIN command in DuckDB differs significantly from that of PostgreSQL. Therefore, I would like to introduce a style option that allows users to obtain more detailed information about the query plan and performance tuning.

That looks really great. I think we should totally add this STYLE option :). Great idea!

@kysshsy kysshsy marked this pull request as ready for review December 6, 2024 14:15
@kysshsy kysshsy requested a review from rebasedming as a code owner December 6, 2024 14:15
@philippemnoel philippemnoel changed the title Enhance explain feat: Enhance explain Dec 6, 2024
@philippemnoel
Copy link
Collaborator

@kysshsy Thank YOU for finishing this! It looks GREAT. Just the Clippy and will be good

@kysshsy
Copy link
Contributor Author

kysshsy commented Dec 8, 2024

@kysshsy Thank YOU for finishing this! It looks GREAT. Just the Clippy and will be good

fixed. :)

@philippemnoel
Copy link
Collaborator

@kysshsy Thank YOU for finishing this! It looks GREAT. Just the Clippy and will be good

fixed. :)

Thank you for making this!!

@philippemnoel philippemnoel merged commit ad3d5b6 into paradedb:dev Dec 8, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance EXPLAIN Statement: Add analyze option, Support style option
2 participants