CREATE INDEX as part of CREATE TABLE statement.

Posted by Ij under Oracle category on | Points: 40 | Views : 697
CREATE INDEX statement is used to create Indexes using table columns.An index allows faster retrieval of records.An index creates an entry for each value that appears in the indexed columns.
You can create indexes explicitly using the SQL statement CREATE INDEX or as a part of CREATE TABLE script.
CREATE [UNIQUE]INDEX indexON table(column1,.. column_n)[STORAGE CLAUSE ];

each row in the table will be uniquely indexed using the index MY_IDX.This will help faster retrieval of records from huge tables.
CREATE TABLE MYTABLE(name varchar2(50),age number,id number, CONSTRAINT my_Constraint unique(name,id) USING INDEX (CREATE UNIQUE INDEX  MY_IDX on MYTABLE(name,id)));

Comments or Responses

Login to post response