zoukankan      html  css  js  c++  java
  • 嵌套循环连接(Nested Loops Joins)

    The nested loops join, also called nested iteration, uses one join input as the outer input

    table(shown as the top input in the graphical execution plan) and one as the inner (bottom)

    input table.The outer loop consumes the outer input table row by row. The inner loop, executed

    for each outer row, searches for matching rows in the inner input table.In the simplest case,

    the search scans an entire table or index; this is called a naive nested loops join.If the search

    exploits an index, it is called an index nested loops join.If the index is built as part of the query

    plan (and destroyed upon completion of the query),it is called a temporary index nested loops join.

    All these variants are considered by the query optimizer.A nested loops join is particularly effective

    if the outer input is quite small and the inner input is preindexed and quite large. In many small

    transactions, such as those affecting only a small set of rows, index nested loops joins are far

    superior to both merge joins and hash joins.In large queries,however, nested loops joins are

    often not the optimal choice.【摘自technet】

    嵌套循环连接,也被称作嵌套迭代,用于连接外部输入表(显示为图形执行计划的顶部输入)和内部输入表的输入

    。外部循环按照行检索外部输入表。内部循环,执行外部的每一行,查询内部输入表匹配的行。最简单的情况,查

    询扫描整个表或者索引;这叫做纯嵌套循环连接。如果查询利用了索引,被称为索引嵌套循环连接。如果索引作为

    查询计划的一部分被构建,这被称作临时索引嵌套循环连接。所有这些变体都会被查询优化器考虑到。当外部输入

    非常小并且内部输入很大且预先添加过索引的时候嵌套循环连接是非常有效的。在许多小的转换中,比如仅仅影响

    很小的行集的情况。索引嵌套连接是远远优于合并连接和哈希连接的。然而,在大数据的查询情况下,嵌套循环连

    接通常不是最好的选择。

  • 相关阅读:
    HUE配置文件hue.ini 的impala模块详解(图文详解)(分HA集群)
    poj 1815 Friendship (最小割+拆点+枚举)
    Android项目中包名的改动
    Android MediaPlayer Error -1004
    hive原生和复合类型的数据载入和使用
    Linux学习笔记之权限与命令之间的关系(重要)及文件与文件夹知识总结
    kafka集群搭建与apiclient创建
    Android中各种Adapter的使用方法
    【从零学习Python】Ubuntu14.10下Python开发环境配置
    leetcode
  • 原文地址:https://www.cnblogs.com/ucos/p/3541089.html
Copyright © 2011-2022 走看看