在探讨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的更多相关文章

  1. MYSQL COST optimizer

    http://blog.chinaunix.net/uid-26896862-id-3326400.html https://www.slideshare.net/olavsa/mysql-optim ...

  2. mysql5.6子查询的优化

    https://dev.mysql.com/doc/refman/5.6/en/subquery-optimization.html Semi-join in MySQL 5.6   MySQL 5. ...

  3. SQL运行内幕:从执行原理看调优的本质

    相信大家看过无数的MySQL调优经验贴了,会告诉你各种调优手段,如: 避免 select *: join字段走索引: 慎用in和not in,用exists取代in: 避免在where子句中对字段进行 ...

  4. Kubernetes服务之“运行单实例的有状态服务”

    目标 在你的环境中创建一个PV 创建一个MySQl的Deployment 在集群中以DNS名称的方式,将MySQL暴露给其他的pod 开始之前 你需要一个Kubernetes集群,一个可以连接到集群的 ...

  5. 深入理解MySql子查询IN的执行和优化

    IN为什么慢? 在应用程序中使用子查询后,SQL语句的查询性能变得非常糟糕.例如: SELECT driver_id FROM driver where driver_id in (SELECT dr ...

  6. 看懂mysql执行计划--官方文档

    原文地址:https://dev.mysql.com/doc/refman/5.7/en/explain-output.html 9.8.2 EXPLAIN Output Format The EXP ...

  7. [MySQL Reference Manual] 8 优化

    8.优化 8.优化 8.1 优化概述 8.2 优化SQL语句 8.2.1 优化SELECT语句 8.2.1.1 SELECT语句的速度 8.2.1.2 WHERE子句优化 8.2.1.3 Range优 ...

  8. mysql中的semi-join

    1. 背景介绍 什么是semi-join? 所谓的semi-join是指semi-join子查询. 当一张表在另一张表找到匹配的记录之后,半连接(semi-jion)返回第一张表中的记录.与条件连接相 ...

  9. Mysql执行计划说明

    Mysql执行计划翻译: 官网原文请见http://dev.mysql.com/doc/refman/5.6/en/explain-output.html:5.6 EXPLAIN语句提供有关SELEC ...

随机推荐

  1. laravel 兜底路由

    在 Laravel 5.6 中,引入了兜底路由功能.所谓兜底路由,就是当路由文件中定义的所有路由都无法匹配用户请求的 URL 时,用来处理用户请求的路由,在此之前,Laravel 都会通过异常处理器为 ...

  2. zoj3659

    #include<iostream> #include<algorithm> #include<cstring> #define ll long long #inc ...

  3. linux下搭建SVN

      官网下载: http://subversion.apache.org/packages.html SVN客户端:TortoiseSVN :https://tortoisesvn.net/downl ...

  4. Play框架--初学笔记

    目录结构 web_app 根目录 | sbt SBT Unix 批处理脚本用于启动sbt-launch.jar | sbt.bat SBT Windows 批处理脚本用于启动sbt-launch.ja ...

  5. 回到未来123Back To The Future

    或许,决定着现在的过去已经无法改变,但决定着未来的现在,却在我们每个人的手里. 路?我们要去的地方不需要路.(Roads? Where we're going we don't need roads) ...

  6. Refs & DOM

    Refs 提供了一种访问在 render 方法中创建的 DOM 节点或 React 元素的方式. 在典型的 React 数据流中, 属性(props)是父组件与子代交互的唯一方式.要修改子组件,你需要 ...

  7. (转载)C#压缩解压zip 文件

    转载之: C#压缩解压zip 文件 - 大气象 - 博客园http://www.cnblogs.com/greatverve/archive/2011/12/27/csharp-zip.html C# ...

  8. Java面向对象三大特性

    封装.继承.多态. 1.封装 封装就是将对象的属性和行为特征包装到一个程序单元(即类)中,把实现细节隐藏起来,通过公用的方法来展现类对外提供的功能,提高了类的内聚性,降低了对象之间的耦合性. 2.继承 ...

  9. centos 6 切换base源

    切换为阿里云源: mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup && wg ...

  10. (三)apache的安装与配置

    一.安装: 推荐使用cygwin自带的Setup.exe.带来的好处不言而喻,所有安装的程序都是经过测试的,这样确保你不会把宝贵的时间浪费来毫无意义的劳动上. 在安装程序中选择两个包就行了(分别是ap ...