Row Hash and number of unique values for primary index

Database

Row Hash and number of unique values for primary index

i have learnt that primary index value is hashed to create a 32 bit row hash and it is bucketed to find the amp . Does this implies that a table can have only 2^32 unique values in primary index?

2 REPLIES
Enthusiast

Re: Row Hash and number of unique values for primary index

 

It is not that you can have only 2^32 (4.2 Billion)values for a UPI. The hashing is primarily to indicate the AMP onto which a row should be distributed into. There can be more than 2^32 values.

If the number of unique values are greater than this number then we may run into a situation called as hash synonyms/hash collisions. Two values map to the same hash in usually 2 different situations: 1) when it is a NUPI on a table in which case the uniqueness value from the row hash(ROWID+uniquenessvalue)determines the row and 2) Hash synonym/hash collision in which once the multiple hash values are found(synonyms), the complete row is scanned to find if the value corresponds to the queried. Please refer the below for more details.

http://www.info.teradata.com/htmlpubs/DB_TTU_14_00/index.html#page/Database_Management/B035_1094_111...

Re: Row Hash and number of unique values for primary index

Thanks Krishna.