12
返回列表 发新帖
楼主: seman18

[讨论] 为什么驱动表返回记录太多就不适合nested loops?

[复制链接]
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
11#
发表于 2009-9-26 02:34 | 只看该作者
原帖由 sqysl 于 2009-9-24 18:42 发表
1、概念是有点乱,这里驱动表是外部表(OUTER TABLE)


You're right. I re-read Oracle documentation and some notes (such as 68084.1 and 10626.1), and my own note (http://yong321.freeshell.org/computer/OracleMisnomers.txt item 10), NL join is

NESTED LOOP JOIN
  OUTER_TABLE
  INNER_TABLE

I just made the correction in my message.

But when we talk about hash joins, it's still better to call them build and probe tables, not outer and inner tables, as commented by Jonathan Lewis in his CBO book (p.308):

"The terms outer and inner are really only appropriate to nested loop joins. When talking about hash joins, you
ought to refer to the build table and probe table; and for merge joins, the terms first table and second table are
sufficient. However, you will find that the 10053 trace file always uses the terms outer and inner to identify
the first and second tables respectively in a join operation. I will revisit this point in the relevant chapters."

Yong Huang

使用道具 举报

回复
论坛徽章:
1
ITPUB8周年纪念徽章
日期:2009-09-27 10:21:22
12#
 楼主| 发表于 2009-9-26 15:21 | 只看该作者
我大概明白了,其实我就是想知道NLJ跟HJ在I/O,CPU上的花销区别,我想这才是当数据量不同的情况下选择不同的join的原因

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表