Creating a Hash Index on the Primary Key Columns of the Cache Table

The UNIQUE HASH ON cache table attribute can be specified for cache tables in any cache group type. Hash indexes give faster full key equality lookups but can be used for inequality (<, <-, >, >=) or range lookups.

UNIQUE HASH ON specifies that a hash index rather than a range index is created on the primary key columns of the cache table. The columns specified in the hash index must be identical to the columns in the primary key. The UNIQUE HASH ON cache table attribute is also used to specify the size of the hash index.

The following example demonstrates how to use the UNIQUE HASH ON cache table attribute on the cache table's definition.

CREATE ASYNCHRONOUS WRITETHROUGH CACHE GROUP new_customers
FROM sales.customer
 (cust_num NUMBER(6) NOT NULL,
  region   VARCHAR2(10),
  name     VARCHAR2(50),
  address  VARCHAR2(100),
  PRIMARY KEY(cust_num))
  UNIQUE HASH ON (cust_num) PAGES = 100;

See CREATE CACHE GROUP in the Oracle TimesTen In-Memory Database SQL Reference.