Put your tips and tricks online - Share your knowledge! Login | Register
 
 
  Search     Advanced search
 

Home | Ask Question | Add tip | Questions | My tips | Recent tips & tricks | Suggest a category | FAQ | Forums

 
 
 
 Category : Home > Databases > Oracle > Oracle 10g     

Oracle Virtual Indexes - How to


Virtual index is a feature of Oracle 10 and Oracle 9. The purpose of virtual indexes is
simulate the existence of an index, without actually building it, so you can explain plan as
if the index existed. It is important to drop the index after you're done with it.

To build a virtual index run the following statement:

SQL> CREATE unique INDEX index_name on table_name(col_name) NOSEGMENT /* virtual index */;

To use the index run the following statement:

SQL> ALTER SESSION SET "_use_nosegment_indexes" = TRUE;

To detect a virtual index in the database run the following sql (this indexes don't have any
columns in dba_ind_columns):

SQL> SELECT index_owner, index_name 
FROM dba_ind_columns
WHERE index_name NOT LIKE 'BIN$%'
MINUS
SELECT owner, index_name 
FROM dba_indexes
/


  Options
 
   del.icio.us  |  newsvine  |  digg  |  furl  |  google  |  yahoo  |  Ma.gnolia  |  vigillar  |  reddit  |  technorati  |  icerocket  |  pubsub

       Rate this tip:    

Start discussion or add comment to this tip

  Details
Tip reference : #57
views : 788
Added on : 11/24/05
Submited by : h8dk97
 
Send a message Send a message Printer friendly output Printer friendly output
Display this member's tips Display this member's tips (149)
 
 
<< Previous Next >>
 Most viewed tips 
  Databases > Oracle > Security : How to unlock Oracle user account  
  Databases > Oracle > Performance Tuning : How to enable trace in Oracle  
  Databases > Oracle : Kill user session  
  Databases > Oracle : Scripts to backup Oracle database on Windows NT  
   
  All categories
Databases | Programming | Hardware | Operating Systems | Networking | Internet | ERP / CRM | Games & Multimedia | Graphics & Design | Miscellaneous | Office Software | TipLib FAQ
 
 

Home |  FAQ |  Terms of Use |  Privacy Policy

© 2005 tiplib.com