paradedb / pg_analytics

DuckDB-powered analytics for Postgres
https://paradedb.com
PostgreSQL License
383 stars 15 forks source link

Enhance explain #146

Open kysshsy opened 1 month ago

kysshsy commented 1 month ago

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 commented 1 month ago

It depends on sqlparser https://github.com/apache/datafusion-sqlparser-rs/pull/1426. Awaiting the next release of the library.

philippemnoel commented 1 month ago

Should this be based off of https://github.com/paradedb/pg_analytics/pull/140?

kysshsy commented 1 month ago

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 commented 1 month ago

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!

kysshsy commented 1 month ago
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 commented 1 month ago

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!