Slow query after upgrade mysql from 5.5 to 5.6

后端 未结 2 607
梦如初夏
梦如初夏 2021-01-16 03:29

We\'re upgrading mysql from 5.5 to 5.6 and some queries are deadly slow now.

Queries that took 0.005 seconds before are now taking 49 seconds.

Queries on 5.6

2条回答
  •  深忆病人
    2021-01-16 03:35

    Ultimately the accepted answer above is correct.

    The help from @RandomSeed got me thinking in the right direction. Basically the optimization plans created in 5.6 are significantly different from those in 5.5, so you'll probably have to rework your query, much like I did.

    I did not end up using the FORCE INDEX, but instead removed portions of the query until I determined what was causing 5.6 to miss the index. Then I reworked the application logic to deal with that.

提交回复
热议问题