optimizer_switch=derived_merge=off

回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

optimizer_switch=derived_merge=off

文章 yehlu »

http://stackoverflow.com/questions/3773 ... -mysql-5-7

https://dev.mysql.com/doc/refman/5.7/en ... tions.html

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)


https://read01.com/RR5gBM.html
在5.7中,由於採用了新的優化方式,我們需要使用 set optimizer_switch=』derived_merge=off』來禁止derived table合併到外層的Query中。
原文網址:https://read01.com/RR5gBM.html
回覆文章

回到「MySQL」