Hash Group By
Starting with 10g, Oracle introduced “Hash Group By” as the default grouping by mechanism.
Oracle employs a hash algorithm to calculate the hash value for each row based on the GROUP BY columns. This allows rows with identical column values (and hence identical hash values) to be "brought together" without performing a full sort. And then the aggregation is performed upon each group. The hash group by does not guarantee the order of the output, one should use “order by” clause to ensure the order.
Sort Join
Sort join is the first operation of the “Sort Merge Join”. Before Oracle joins two row sources, both row sources have to be in order. If required, Oracle does a sort. The name is a bit misleading. All it does is a sort on the join key.
The “Sort Merge Join” consists of two steps:
- Sort join operation. Both the inputs are sorted on the join key.
- Merge join operation. The sorted lists are merged.
Merge Join Cartesian
笛卡尔积式的Merge Join. 只有在两个结果集都很小时,该操作是合理的。 看到它,请检查你的SQL,是否漏了join.
Buffer Sort
Oracle将某些数据放入缓存,以便重复访问。 其实没有排序发生!
Oracle HashGroupBy与SortJoin技术详解
本文深入探讨了Oracle中HashGroupBy和SortJoin技术的原理与应用,包括HashGroupBy的默认分组机制、SortJoin作为SortMergeJoin的第一步如何确保分发源有序,以及MergeJoin的不同类型如笛卡尔积式的MergeJoin。此外,还阐述了BufferSort的作用,即某些数据的缓存以供重复访问,而实际上并无排序发生。
1057

被折叠的 条评论
为什么被折叠?



