User Guide : 11. Creating Indexes : Creating Indexes : Create a Primary (Clustered) Index
 
Share this page                  
Create a Primary (Clustered) Index
A clustered index (also known as a primary index in Vector) is a table organized as an index.
Use a primary index only if the table is predominantly accessed through the indexed columns. If the table is often filtered or joined only on non-indexed columns then the index will likely slow down rather than improve query performance.
Restrictions are as follows:
• Create a primary index after creating the table.
• Only one primary index is allowed per table.
• An initial bulk load into the table is directly and efficiently written to disk. Subsequent updates are always loaded into memory first, unless the COMBINE operation (see MODIFY...TO COMBINE Statement--Merge and Update Data) is used.
To create a primary index
Enter your CREATE INDEX statement at the terminal monitor prompt. The following example creates an index named l_idx on the l_shipdate column of the lineitem table:
CREATE INDEX l_idx ON lineitem(l_shipdate);