Oracle Hash Group By

chncaesar發表於2013-11-08

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.

 

select time_id, sum(amount_sold) from sales group by time_id;


 

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/638844/viewspace-776150/,如需轉載,請註明出處,否則將追究法律責任。

相關文章