SQL Language Guide : 8. SQL Statements : CREATE INDEX : CREATE INDEX Examples
 
Share this page                  
CREATE INDEX Examples
1. Create a primary index named l_idx on the l_shipdate column of the lineitem table:
CREATE INDEX l_idx ON lineitem(l_shipdate);
2. Create a primary index named o_order_date_idx on the order_date column of the orders table:
CREATE INDEX o_order_date_idx ON orders(order_date);
3. Create a secondary index named si_supplier on the s_name column of the supplier table:
CREATE INDEX supplier_sidx ON supplier (s_name) WITH STRUCTURE=VECTORWISE_SI;
4. Create a secondary index named si_cars on certain columns of the cars table:
CREATE INDEX cars_sidx ON cars (model_id, body_type, color, year_produced) WITH STRUCTURE=VECTORWISE_SI;