INDEXES: SORT and NOSORT

Submitted by:David Villa

Date added:29 March, 2015

Category:PL SQL

When creating an index, the default method Oracle uses to sort the index is in ascending order (SORT). However, if the rows are already stored in the database in ascending order you can use the NOSORT clause to skip the sorting process.
If neither SORT or NOSORT is provided, Oracle will use SORT as the clause.

Tags: creating index , sort , nosort

Code Snippet:

CREATE INDEX <index_name>
ON <table_name> (<column_name>)
PCTFREE <integer>
TABLESPACE <tablespace_name>
[SORT | NOSORT];

---- for example:

CREATE UNIQUE INDEX IDX_WS_INVOICE ON WS_INVOICE
(cust_num,order_year,client_code,note_id,record_id)
tablespace sales_us
nologging
nosort ;
 
 

Comments