Use CREATE INDEX
Use the CREATE INDEX statement to create an index on one or more columns in a table and, optionally, to cluster the physical table in the order of the index. This section describes some of the options available when you create indexes. For more information about the CREATE INDEX statement, see the IBM® Informix® Guide to SQL: Syntax.
Suppose
you create table customer:
CREATE TABLE customer
(
cust_num SERIAL(101) UNIQUE
fname CHAR(15),
lname CHAR(15),
company CHAR(20),
address1 CHAR(20),
address2 CHAR(20),
city CHAR(15),
state CHAR(2),
zipcode CHAR(5),
phone CHAR(18)
);
The following statement shows how to create an
index on the lname column of the customer table:
CREATE INDEX lname_index ON customer (lname);