MySQL Forums
Forum List  »  Performance

select query not using indexes
Posted by: senthil kumaran
Date: June 11, 2008 01:05AM

Hi All,
One of my tables have more than 10M rows with ID column as Primary key. While doing select query with ID >0 AND ID < 1000000 with group by,it never use indexes (ID as well as other field's indexes) and it's explain query states it's type as 'ALL'. If I reduce the range value, explain shows it's type as RANGE.

How mysql optimizer decide the type as RANGE in one case and ALL if it's range slightly increased?
Also anyone suggest how can I make the optimizer to use Index (I've tried Force index which not useful)?

Regards
Kumaran

Options: ReplyQuote


Subject
Views
Written By
Posted
select query not using indexes
3186
June 11, 2008 01:05AM
1733
June 11, 2008 04:44AM
1679
June 15, 2008 07:44PM
1696
June 16, 2008 06:45PM
1549
June 21, 2008 05:56PM
1529
June 23, 2008 11:49PM
1817
June 27, 2008 11:23PM
1613
June 18, 2008 08:22AM


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.