Skip to content
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

@ajnavarro

Description

@ajnavarro

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy