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

hash join 和普通index 访问的异同

[复制链接]
论坛徽章:
15
祖国60周年纪念徽章
日期:2009-10-09 08:28:002009架构师大会纪念徽章
日期:2010-01-18 13:43:21ITPUB十周年纪念徽章
日期:2011-11-01 16:20:28
11#
 楼主| 发表于 2006-2-16 11:57 | 只看该作者
but another question is been asked

how the hash table are organised

使用道具 举报

回复
论坛徽章:
15
祖国60周年纪念徽章
日期:2009-10-09 08:28:002009架构师大会纪念徽章
日期:2010-01-18 13:43:21ITPUB十周年纪念徽章
日期:2011-11-01 16:20:28
12#
 楼主| 发表于 2006-2-16 11:58 | 只看该作者
confused

使用道具 举报

回复
论坛徽章:
0
13#
发表于 2006-2-16 13:56 | 只看该作者
hash join 时 oracle访问一张表,在内存中建立键的hash表,然后扫描连接中的其他表,根据hash表检测匹配的记录。

相关的参数:
hash_join_enabled=true
PGA_AGGREGATE_TARGET设得足够大(HASH_AREA_SIZE向下兼容)

使用道具 举报

回复
论坛徽章:
15
祖国60周年纪念徽章
日期:2009-10-09 08:28:002009架构师大会纪念徽章
日期:2010-01-18 13:43:21ITPUB十周年纪念徽章
日期:2011-11-01 16:20:28
14#
 楼主| 发表于 2006-2-16 15:07 | 只看该作者
Hashing is so cool. It’s lightening fast and requires only a small amount of memory
as opposed to a large amount of disk space (think index) or CPU time (think cost
based optimization). There is basically a simple calculation, a jump to a memory
location, and then hopefully a short in-memory sequential search. When the
sequential search is short, the result is an incredibly fast search...much faster than
using any kind of index or a cost based approach.
Hashing consists of only a few components; a hash function, hash buckets, and hash
chains. I’ll take a minute to describe each of these.

使用道具 举报

回复
论坛徽章:
15
祖国60周年纪念徽章
日期:2009-10-09 08:28:002009架构师大会纪念徽章
日期:2010-01-18 13:43:21ITPUB十周年纪念徽章
日期:2011-11-01 16:20:28
15#
 楼主| 发表于 2006-2-16 15:10 | 只看该作者
Hashing algorithm   is in the  so many oracle compents

使用道具 举报

回复
论坛徽章:
15
祖国60周年纪念徽章
日期:2009-10-09 08:28:002009架构师大会纪念徽章
日期:2010-01-18 13:43:21ITPUB十周年纪念徽章
日期:2011-11-01 16:20:28
16#
 楼主| 发表于 2006-2-16 15:10 | 只看该作者
so important

使用道具 举报

回复
论坛徽章:
15
祖国60周年纪念徽章
日期:2009-10-09 08:28:002009架构师大会纪念徽章
日期:2010-01-18 13:43:21ITPUB十周年纪念徽章
日期:2011-11-01 16:20:28
17#
 楼主| 发表于 2006-2-16 15:43 | 只看该作者

使用道具 举报

回复
论坛徽章:
15
祖国60周年纪念徽章
日期:2009-10-09 08:28:002009架构师大会纪念徽章
日期:2010-01-18 13:43:21ITPUB十周年纪念徽章
日期:2011-11-01 16:20:28
18#
 楼主| 发表于 2006-2-16 16:59 | 只看该作者
just as the data structure of hash table

使用道具 举报

回复
论坛徽章:
27
授权会员
日期:2005-10-30 17:05:33管理团队成员
日期:2011-05-07 01:45:082012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:362012新春纪念徽章
日期:2012-02-13 15:11:36优秀写手
日期:2013-12-18 09:29:13马上有车
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14
19#
发表于 2006-2-17 00:37 | 只看该作者
最初由 caoliwei 发布
[B]but another question is been asked

how the hash table are organised [/B]


不知道你具体想问什么

举个简单的例子

table T1: column A values: A, B , C
table T2: column B values:A, E, F , C , M....

有查询
select T2.B from T1,T2 where T1.A=T2.B

Hash join下选择table A来建立hash table

hash函数Fn(x) = i

Fn(A)=1
Fn(B)=2
Fn(C)=3

所以依照table T1建立的hash table里面就有1,2,3三个值

这时读取table T2中的数据,经过同样的hash函数Fn(x)=i运算

Fn(A)=1命中
Fn(E)=5不能命中
Fn(F)=6不能命中
Fn(C)=3命中
.....

使用道具 举报

回复

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

本版积分规则 发表回复

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