MySQL Forums
Forum List  »  Performance

Re: Please help :)
Posted by: Sergey Petrunya
Date: April 21, 2005 03:09PM

How many records are in the table?
What does EXPLAIN SELECT .. FROM ipcountryNEW FORCE INDEX (`PRIMARY`) show?

One of the problems here is that condition "ipFROM>=1142156934 AND ipTO<=1142156934" is
converted to search predicate
(ipFROM, ipTO) < (1142156934, -inf)
That is, only first part of the condition can be used for index.

Are the intervals in the ipcountryNEW table disjoint? If yes, you could add LIMIT 1 to the query. This will force index usage (and it will be fast).

Sergey Petrunia, Software Developer
MySQL AB, www.mysql.com
My blog: http://s.petrunia.net/blog

Options: ReplyQuote


Subject
Views
Written By
Posted
2125
April 18, 2005 04:18PM
Re: Please help :)
1506
April 21, 2005 03:09PM


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.