Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 

 

 

Oracle Creating Indexes

Oracle Database Tips by Donald Burleson

     

Question:

I have few doubts concerning Index creations. Can you please help me?

I have a table called PLANTEST as shown below:  

CREATE TABLE PLANTEST (A NUMBER, B VARCHAR2(10)) 

I have also created two Non-Unique Indexes, for both the columns separately, as shown below:

CREATE INDEX IND ON PLANTEST(A)

CREATE INDEX IND_B ON PLANTEST(B)

When I execute the query below, Oracle is hitting Index and fetching the values:

SELECT A FROM PLANTEST WHERE A = 3 

However, when I execute the query below, system is not hitting the Index:

SELECT A, B FROM PLANTEST WHERE A = 3 (nor) SELECT B FROM PLANTEST WHERE

A = 3 --> Not Hitting Index

Can you please tell me how should I change my index/query so that Index is hit?

Like the prior queries, this is for Character queries:

SELECT B FROM PLANTEST WHERE B LIKE 'A%'

SELECT A FROM PLANTEST WHERE B LIKE 'A%' --> Full Table Scan

Thank you.

This question posed on 25 November 2005

Answer:

The issue is Oracle doesn't know how to equate the two indexes. Therefore if you select from the table where either index can be used, it will, but if you require a column that is not in the index then it must also look at the  table to read the value.

What makes you believe it is not hitting the index? It is probably using the index to find the table ROWIDS then hitting the table to find the values not in the index. Try a concatenated index.

 


 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.