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_NAME TABLESPACE_NAME CLUSTER_TYPE
COURSE_CLUSTER SYSTEM INDEX

Check index

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

Output:

INDEX_NAME INDEX_TYPE TABLE_NAME
IDX_COURSE_CLUSTER CLUSTER COURSE_CLUSTER