Create Cluster Index

Create Cluster Index example


-- create Cluster
CREATE CLUSTER course_cluster
   (course NUMBER(9))
SIZE 512 
STORAGE (initial 100K next 50K);

-- create Index on Cluster
CREATE INDEX idx_course_cluster
  ON CLUSTER course_cluster; 

Output:

cluster COURSE_CLUSTER created.
index IDX_COURSE_CLUSTER created.

Check cluster

SELECT CLUSTER_NAME, TABLESPACE_NAME, CLUSTER_TYPE 
FROM USER_CLUSTERS;

Output:

CLUSTER_NAMETABLESPACE_NAMECLUSTER_TYPE
COURSE_CLUSTERSYSTEMINDEX

Check index

SELECT INDEX_NAME, INDEX_TYPE, TABLE_NAME
FROM USER_INDEXES
WHERE INDEX_TYPE='CLUSTER'; 

Output:

INDEX_NAMEINDEX_TYPETABLE_NAME
IDX_COURSE_CLUSTERCLUSTERCOURSE_CLUSTER