We all know that, in DB2, there are different data access methods present. Either by using index are scanning methods. Hash index is a new technique in DB2 V10. The concept is not new this is already being used in Teradata RDBMS and an IMS database.
What is the Hash index?
When creating a Table defined with the Hash index, the values in the columns of the Hash index will pass through the hashing algorithm.
Then hashing algorithm will assign a single integer for each value in the hash indexed column. This single integer acts as an index, and data will be stored in a designated storage location. The below figure describes how the hash index works.
Create table statement-ORGANIZE BY HASH UNIQUE (column-names) HASH SPACE (hash-space-value). This tells DB2 to use a Hash index technique for organizing data of a table.
Unique-Tells that no two values should be the same in hash indexed columns
Hash space-The The amount of fixed hash space pre-allocated for the table.