Home » Other » General » [ask] ora hash in partitioning table by hash (oracle 10g)
[ask] ora hash in partitioning table by hash [message #463370] Thu, 01 July 2010 00:55 Go to next message
ekopur
Messages: 9
Registered: June 2010
Location: indonesia
Junior Member
hi all,

i want to ask about ora hash function in partitioning table, how ora hash function working spread record in each partition??

best regard,
pur
Re: [ask] ora hash in partitioning table by hash [message #463387 is a reply to message #463370] Thu, 01 July 2010 02:23 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Using an internal algorithm which is not known and may change from version to version.

Database VLDB and Partitioning Guide
Chapter 2 Partitioning Concepts
Section Hash Partitioning

Quote:
Hash partitioning maps data to partitions based on a hashing algorithm that Oracle applies to the partitioning key that you identify. The hashing algorithm evenly distributes rows among partitions, giving partitions approximately the same size.
...
Note: You cannot change the hashing algorithms used by partitioning.


Regards
Michel
Re: [ask] ora hash in partitioning table by hash [message #463398 is a reply to message #463387] Thu, 01 July 2010 03:07 Go to previous messageGo to next message
ekopur
Messages: 9
Registered: June 2010
Location: indonesia
Junior Member
thanks for your reply michel,

i do not want change hashing algorithm,but i just want to know how hash algorithm work in partitioning table by hash,how hash algorithm distributes record to each partition??

regards
pur
Re: [ask] ora hash in partitioning table by hash [message #463403 is a reply to message #463398] Thu, 01 July 2010 03:24 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
As I said, you can't know the algorithm.

Regards
Michel
Re: [ask] ora hash in partitioning table by hash [message #463408 is a reply to message #463403] Thu, 01 July 2010 04:12 Go to previous messageGo to next message
ekopur
Messages: 9
Registered: June 2010
Location: indonesia
Junior Member
michel, i read some artikel in asktom.oracle.com ( http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:981835183841#692992200346988718 )
Quote:

Consider, these 4 variables (part_col, no_of_part, bucket_size, prev_2_power)

part_col be candidate partitioning column

no_of_part is the number of partitions we are considering

bucket_size is derived from no_of_part as follows:

if no_of_part is powers of 2(2,4,8,16...) then
bucket_size = no_of_part - 1

else if no_of_part not powers of 2 then
bucket_size = "next higher power of 2" - 1
for eg, if you have 24 no_of_part then (32 -1) = 31

prev_2_power is no_of_part if its a power of 2 number else its previous power of 2. for ex. for 24 partitions, 16 would be prev_2_power

THEN
Partition Number =

case
ora_hash(part_col, bucket_size)+ 1 > no_of_part
then
ora_hash(part_col, bucket_size)+ 1 - prev_2_power
else
ora_hash(part_col, bucket_size)+ 1 /* +1 since bucket start with 0 but partitions start with 1 */
end;


is that true algorithm??

regards
pur

[Updated on: Thu, 01 July 2010 04:21] by Moderator

Report message to a moderator

Re: [ask] ora hash in partitioning table by hash [message #463415 is a reply to message #463408] Thu, 01 July 2010 04:26 Go to previous message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
This is part of the algorithm, but you don't know the main point: how ora_hash function works and I thought this was your actual question.

Regards
Michel
Previous Topic: Oracle 10g2R2 - Licensing in different versions
Next Topic: Help on Oracle topics
Goto Forum:
  


Current Time: Fri Dec 27 06:01:08 CST 2024