This repository was archived by the owner on Jan 28, 2021. It is now read-only.
This repository was archived by the owner on Jan 28, 2021. It is now read-only.
Add support for basic query EXPLAIN #216
Closed
Description
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
.