Home » RDBMS Server » Server Administration » Reverse Index
Reverse Index [message #57207] Wed, 28 May 2003 08:21 Go to next message
Kumar
Messages: 115
Registered: December 1998
Senior Member
I want to know how to create an Index which would be built in Descending order. Means.. the Latest record kept on top.
My volume of my table is quite high. And the programs would be accessing the Latest records mostly.

Pls help.
Thanks in advance - Kumar
Re: Reverse Index [message #57231 is a reply to message #57207] Thu, 29 May 2003 07:02 Go to previous message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
quoting the docs
Creating a reverse key index, compared to a standard index, reverses the bytes of each column indexed 
(except the rowid) while keeping the column order. Such an arrangement can help avoid performance 
degradation in an Oracle Parallel Server environment where modifications to the index are concentrated on a 
small set of leaf blocks. By reversing the keys of the index, the insertions become distributed across all 
leaf keys in the index. 

Using the reverse key arrangement eliminates the ability to run an index range scanning query on the 
index. Because lexically adjacent keys are not stored next to each other in a reverse-key index, only fetch-
by-key or full-index (table) scans can be performed. 

Sometimes, using a reverse-key index can make an OLTP Oracle Parallel Server application faster. For 
example, keeping the index of mail messages in an email application: some users keep old messages, and 
the index must maintain pointers to these as well as to the most recent. 

The REVERSE keyword provides a simple mechanism for creating a reverse key index. You can specify the 
keyword REVERSE along with the optional index specifications in a CREATE INDEX statement: 

CREATE INDEX i ON t (a,b,c) REVERSE; 

You can specify the keyword NOREVERSE to REBUILD a reverse-key index into one that is not reverse keyed: 

ALTER INDEX i REBUILD NOREVERSE; 

Rebuilding a reverse-key index without the NOREVERSE keyword produces a rebuilt, reverse-key index. You cannot rebuild a normal index as a reverse key index; you must use the CREATE statement instead. 

Previous Topic: DBLink Slow Performance
Next Topic: Where are column aliases in views stored?
Goto Forum:
  


Current Time: Mon Dec 30 16:48:14 CST 2024