Is there a way to explain a DELETE query with MySQL like we can explain a SELECT query?
Asked
Active
Viewed 1.3k times
18
Gaël J
- 7,665
- 4
- 16
- 29
user217631
- 1,258
- 5
- 18
- 31
2 Answers
37
"As of MySQL 5.6.3, EXPLAIN provides information about SELECT, DELETE, INSERT, REPLACE, and UPDATE statements. Before MySQL 5.6.3, EXPLAIN provides information only about SELECT statements."
Niro
- 756
- 8
- 15
9
Wouldn't the plan for that be the same as for a select 1 where.... with the same condition as your delete query?
The 1 is so the optimizer isn't forced to pull any unneeded columns, it can only look at the columns it needs for the filtering conditions.
Blindy
- 60,429
- 9
- 84
- 123