My Oracle Support Banner

Why Does The Same Query Sometimes Get Different Explain Plans / Suddenly Take Longer to Execute (Doc ID 1499963.1)

Last updated on JANUARY 04, 2024

Applies to:

MySQL Server - Version 5.1 and later
Information in this document applies to any platform.


An expected clone ( ie an identical restore or a replication replica ) of an arbitrary DB should have identical data and schema and even hardware, however an SQL statement, executed on the 2nd host can take much longer than the original.

If resourcing for the servers are identical and their configs also, then all that is left is to check the EXECUTION PLAN for the SQL .

This will likely show differences, either in the order of the tables or different indexes completely.

This difference can persist even after running ANALYZE TABLE to update InnoDB statistics for the tables.




To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document
 Cause 1
 Cause 2.
 Solution 1.
 Solution 2.

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.