I can imagine that it's actually more important to explain SELECT statements, but I wonder why there's no possibility to use EXPLAIN on UPDATEs/INSERTs. I may use a WHERE-statement in an UPDATE where indexes are being used (I guess?), it should be possible to see if they are actually used. Additionally, in the case of using a SELECT-statement inside an UPDATE, I also cannot use explain for this part without getting a syntax error.
Did I misunderstand something about the processes on UPDATEs and INSERTs? How else can I else debug those statements?
Add a comment
|
1 Answer
MySQL currently doesn't support this (unlike nearly all other DBMS).
I think this will be in 5.6 but I'm not entirely sure.
I don't think there is any workaround for that (except upgrading to a DBMS that does support this)
-
1It is in MySQL 5.6 (still in dev.)ypercubeᵀᴹ– ypercubeᵀᴹ2012-07-31 16:15:32 +00:00Commented Jul 31, 2012 at 16:15
-
@ypercube: thanks for the confirmation. I just heard that it's finally going to come but wasn't sure in which version.user1822– user18222012-07-31 16:16:52 +00:00Commented Jul 31, 2012 at 16:16
-
I have been mistakenly thinking it was added in MariaDB but it's only in MySQL 5.6ypercubeᵀᴹ– ypercubeᵀᴹ2012-07-31 16:18:52 +00:00Commented Jul 31, 2012 at 16:18
-
Thanks. It seems 5.6 turns out to be a really desirable version, thinking of fulltext-search in InnoDB and now the fact about the explain...it's just curious why quite essential features (in my opinion) aren't implemented yet.32bitfloat– 32bitfloat2012-07-31 18:47:02 +00:00Commented Jul 31, 2012 at 18:47
-
1@32bitfloat: any of the commercial ones and PostgreSQL in the OpenSource league.user1822– user18222012-07-31 19:54:57 +00:00Commented Jul 31, 2012 at 19:54