Re: Query Optimization
Here's my telephone book analogy for explaining compound indexes:
Find me all people in the phone book whose first name is "Joe".
The phone book is indexed by (last_name, first_name).
So why do I need to scan every page to find all the Joe's?
Answer: searching by part of a compound index _not_ including the leftmost part can't gain any benefit from using the index.
In your query, you reference only the second part of the idx_main index. So it can't use that index.
Regards,
Bill K.
Subject
Views
Written By
Posted
3908
April 26, 2006 01:57PM
Re: Query Optimization
2117
April 26, 2006 04:46PM
1999
April 26, 2006 04:56PM
2207
April 26, 2006 05:29PM
1963
May 03, 2006 03:11PM
1977
May 03, 2006 03:31PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.