MySQL Forums
Forum List  »  Optimizer & Parser

Re: inner join on range criteria: unable to use index?
Posted by: KimSeong Loh
Date: August 12, 2008 01:38AM

Lets say you have 1000 rows, with value 0 to 999, and you have an index.

If you want to find all rows with value > 1, is it better to use the index or just read all the row?

The above is for 1 range condition.



If you have 2 range conditions, then it becomes more complicated. Usually only 1 range condition might be able to take advantage of the index, the other one not so useful anymore.

Lets take another example, you have a printed phone book that is sorted by the lastname follow by firstname. How do you find all people with lastname > 'b' and firstname <'d'. Is it easy or difficult?

Compare this with finding all people with lastname < 'b'.

And compare with finding all people with lastname < 'b' and firstname < 'b', would this any easier compare to the lastname < 'b' only?

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: inner join on range criteria: unable to use index?
3454
August 12, 2008 01:38AM


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.