DB2 V10-New Access Method~Hashing (1 of 2)

Upto Db2 V10, data in the db2 can be accessed by either Indexing or Scanning. The new method is called Hashing. Hashing-it is not New. It is old technology. IMS data bases founded upon hashing.

Image from bookHash function is an algorithm. It converts data elements into a single integer. This number serves an index to database.

How to create table with Hash function?

CREATE TABLE DSN81010.DEPT
 (DEPTNO    CHAR(3) NOT NULL,
   DEPTNAME  VARCHAR(36) NOT NULL,
   MGRNO     CHAR(6),
   ADMRDEPT  CHAR(3) NOT NULL,
   LOCATION  CHAR(16),
   PRIMARY KEY (DEPTNO)
 )
   IN DSN8D10A.DSN8S10D
   ORGANIZE BY HASH UNIQUE (DEPTNO)
   HASH SPACE 64 M;

Hash space: It is defined area used for Hash access.

Advertisements

Author: Srini

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