MySQL Forums
Forum List  »  MyISAM

Re: How do I get mysql to use the keys?
Posted by: Ingo Strüwing
Date: April 25, 2005 02:35AM

This is not a MyISAM question, I guess.
I can only speculate about what the optimizer does.
In the first query, the BETWEEN is used in an unusual way. The optimizer might not be designed for this type of query (yet).
Your primary key is the concatenation of two integers. For a range scan it would be possible to use a condition on the first part of the key only. In your second query it would mean to start the table scan at the position where ipFROM>=1142156934 until the end of the index. But if this is a big part of the index, it might be faster to scan the data file only, instead of scanning the index and pick the corresponding data rows by random access. I think this is indicated by 'possible_keys' = 'PRIMARY' and 'key' = 'NULL'.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: How do I get mysql to use the keys?
2246
April 25, 2005 02:35AM


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.