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

implement EXPLAIN and EXPLAIN PLAN #2784

Merged
merged 6 commits into from
Dec 6, 2024
Merged

implement EXPLAIN and EXPLAIN PLAN #2784

merged 6 commits into from
Dec 6, 2024

Conversation

jycor
Copy link
Contributor

@jycor jycor commented Dec 5, 2024

Moving our current implementation of EXPLAIN to EXPLAIN PLAN, and replace EXPLAIN with a dummy implementation of MySQL's EXPLAIN

Looks like this now:

tmp2/main> explain select * from t;
+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+-------+
| id | select_type | table | partitions | type | possible_keys | key  | key_len | ref  | rows | filtered | Extra |
+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+-------+
| 1  | SELECT      | NULL  | NULL       | NULL | NULL          | NULL | NULL    | NULL | NULL | NULL     |       |
+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+-------+
1 row in set (0.00 sec)

tmp2/main> explain plan select * from t;
+------------------+
| plan             |
+------------------+
| Table            |
|  ├─ name: t      |
|  └─ columns: [i] |
+------------------+
3 rows in set (0.00 sec)

related: dolthub/dolt#8592

Copy link
Contributor

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

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

lgtm, seems like it might be a bit disruptive

@@ -43,4 +43,4 @@ require (
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect
)

go 1.22.2
go 1.23.3
Copy link
Contributor

Choose a reason for hiding this comment

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

do you wanna do this in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

might as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh wait, this is from vitess having a newer version of go...


dummyRow := sql.Row{
1, // id
"SELECT", // select_type
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe include a warning as long as the output isn't useful

@jycor jycor merged commit 151301a into main Dec 6, 2024
7 of 8 checks passed
@jycor jycor deleted the james/explain-plan branch December 6, 2024 19:56
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.

2 participants