List:General Discussion« Previous MessageNext Message »
From:Mike Grover Date:May 7 2002 9:15pm
Subject:Query Speed...
View as plain text  
I have the following query statement:

select * from `ny` where 
latitude >= '040882555' and
latitude <= '040897027' and
longitude >= '073805264' and
longitude <= '073819736';

I have a combined index on latitude,longitude. (keylen 20)

Explain says that it is using the entire key length for the query
And that it has to read 30,530 records to satisfy the query.
Result set = 620 records.


With the following query:

select * from `ny` where 
latitude >= '040882555' and
latitude <= '040897027';

Explain says that it is using half the key length (10 char) for the
query
And that it has to still read 30,530 records to satisfy the query.
Result set = 620 records.

Is there a way to get MySQL 4 to use both Fields from the index
To satisfy the query?

I mean, Only read the the index for Query and read records after
Finding query matches?

 Thanx, Mike 


Thread
Query Speed...Mike Grover7 May
  • RE: Query Speed...Cal Evans8 May
    • Re: Query Speed...Jeremy Zawodny8 May
    • Re: Query Speed...Mike Grover8 May
  • Re: Query Speed...Jeremy Zawodny8 May