首页 > 数据库技术 > 详细

MySQL firstmatch strategy

时间:2017-01-10 14:48:16      阅读:206      评论:0      收藏:0      [点我收藏+]

在探讨subquery如 x IN (SELECT XX FROM TABLE)这样的形式的MATCH策略时,不是很清楚实现过程。在网上搜了一下,

地址:http://stackoverflow.com/questions/22300291/what-does-firstmatch-mean-in-a-explain-statement

 

It is a strategy that avoids the production of duplicates by short-cutting execution as soon as the first genuine match is found.

So FirstMatch(phonenumbers) means that as soon as we have produced one matching record combination, it will short-cut the execution and jump back to the phonenumbers table.

From FirstMatch strategy

  • The FirstMatch strategy works by executing the subquery and short-cutting its execution as soon as the first match is found.
  • This means, subquery tables must be after all of the parent select‘s tables that are referred from the subquery predicate.
  • EXPLAIN shows FirstMatch as "FirstMatch(tableN)".
  • The strategy can handle correlated subqueries.
  • But it cannot be applied if the subquery has meaningful GROUP BY and/or aggregate functions.
  • Use of the FirstMatch strategy is controlled with the firstmatch=on|off flag in the optimizer_switch variable.

MySQL firstmatch strategy

原文:http://www.cnblogs.com/oDoraemon/p/6269168.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!