I want to analyze my update query for optimizing purpose. But when I did so I got an error #1064 in response. Why I see an error when I EXPLAIN for update query? My query for which I tried is followed:
EXPLAIN UPDATE categories SET name='books' WHERE id =1;
Because
EXPLAIN is used only with SELECT statements in MySQL that is why you were getting #1064 error while running
EXPLAIN with UPDATE statement. So, there is no way to
EXPLAIN UPDATE query. However, you can analyze your UPDATE query by converting it like this:
EXPLAIN SELECT name FROM categories WHERE id =1;