Not the answer you need?
Register and ask your own question!

mysql 5.5 bad query plan

jsvishaljsvishal EntrantCurrent User Role Beginner


0down votefavorite

I am using mysql 5.5 with innodb. I ran into an issue where one particular query suddenly started using sub optimal query plan. Prior to this, the query was working fine with a response time of 1 second or so. But suddenly mysql started using a different query plan with a different index which was least selective resulting in a response time of 200+ secs. Can somebody explain why this would happen? When I ran the same query with an index hint of the correct index, all the subsequent runs of the query started using the new query plan.
Can somebody please provide some explanation to the root cause of this issue? One possible thing I can think of is the table statistics would be out of date but I don't think the underlying table data changed so drastically that it would completely change the query plan and use a new index


Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.