query extremely slow after migration to mysql 5.7

后端 未结 3 851
执笔经年
执笔经年 2021-01-02 13:14

I have a MySQL database with InnoDB tables summing up over 10 ten GB of data that I want to migrate from MySQL 5.5 to MySQL 5.7. And I have a query that looks a bit like:

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-02 13:47

    As can be read in the comments, @wchiquito has suggested to look at the optimizer_switch. In here I found that the switch derived_merge could be set to off, to fix this new, and in this specific case undesired, behaviour.

    set session optimizer_switch='derived_merge=off'; fixes the problem.
    (This can also be done with set global ... or be put in the my.cnf / my.ini)

提交回复
热议问题