I am working with an Oracle database and I need to be able to partition the data in a table. I understand that Rracle has an ora_hash function that can partition the data into buckets. Is the ora_hash function deterministic?
In my program I will be making several different database queries with each query asking for a different bucket number.
For example, in one query I might ask for the first two buckets:
SELECT * FROM sales WHERE ORA_HASH(cust_id, 9) in (0,1);
In a subsequent query I might ask for the 2nd and 3rd bucket:
SELECT * FROM sales WHERE ORA_HASH(cust_id, 9) in (1,2);
In the above example, will ora_hash always divide the table into the exact same 10 buckets? Assume that the data in the tables hasn't changed. Will the second bucket (bucket 1), be identical in both queries?
There is documentation that suggests that seed value enables oracle to return different results for the same data set. So I am assuming that if I don't use seed value, then ora_hash will be deterministic. See the documentation.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…