Skip to content

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

)

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.

3 participants