zoukankan      html  css  js  c++  java
  • MySQL firstmatch strategy

    在探讨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.
  • 相关阅读:
    令Django 视图有默认 login_required
    sql语句 case
    java进制转换
    倒水问题
    全排列
    数据库范式
    操作系统——磁盘设备管理
    Windows系统安装MySQL
    Java题库——Chapter16 JavaFX UI组件和多媒体
    Java题库——Chapter15 事件驱动编程和动画
  • 原文地址:https://www.cnblogs.com/oDoraemon/p/6269168.html
Copyright © 2011-2022 走看看