Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

Add support for basic query EXPLAIN #216

Closed
ajnavarro opened this issue Jun 13, 2018 · 0 comments
Closed

Add support for basic query EXPLAIN #216

ajnavarro opened this issue Jun 13, 2018 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@ajnavarro
Copy link
Contributor

Explain query output has a really difficult to implement format: https://dev.mysql.com/doc/refman/8.0/en/explain-output.html

To be able to show some information to the user, we can do a small workaround and implement a specific, MySQL language compatible EXPLAIN statement format:

[EXPLAIN|DESCRIBE|DESC] FORMAT=TREE [query]

The output will be one column, one string row with the string tree representation of the generated logical plan:

mysql> EXPLAIN FORMAT=TREE SELECT * FROM repositories where repository_id != "blah";
+------------------------------------------------------------+
|                            plan                            |
+------------------------------------------------------------+
|Project(repositories.repository_id)                         |
| └─ PushdownProjectionAndFiltersTable                       |
|     ├─ Columns(repositories.repository_id)                 |
|     ├─ Filters(NOT(repositories.repository_id = "blah"))   |
|     └─ Table(repositories)                                 |
|         └─ Column(repository_id, TEXT, nullable=false)     |
+------------------------------------------------------------+

Maybe is worth it add more plans like parsed, analyzed and optimized.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants