DB2-Hash Index Functionality

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 in IMS database.

What is Hash index?

When create Table defined with Hash index, the values in the columns of Hash index, will pass through 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 designated storage location. The below figure describes how hash index works.

Create table statement-ORGANIZE BY HASH UNIQUE (column-names) HASH SPACE (hash-space-value). This tells DB2 to use 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 amount of fixed hash space pre-allocated for the table.


Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.

Comments are closed.