Slow mysql query

software development


can someone please tell me why this query is so slow. it just queries one table although it has a lot of conditions. is there any qay to speed it up? if i run this directly from phpmyadmin it takes 9.1496 sec.

SELECT StreetName, StreetNum, City, ListPrice, Latitude, Longitude, MLSNum, Beds, BathsFull, BathsHalf, GarageCap, GeocodePrecision
FROM residentials
ListPrice >=0
AND ListPrice <= '225000’
AND Beds >= '1’
AND Stories >=0
AND Stories <=10
AND SqFtTotal >= '1000’
AND SqFtTotal <=100000
AND PropSubType
IN (
AND Latitude >= '30.147502278499243’
AND Latitude <= '30.385907241796573’
AND Longitude >= '-98.04336547851562’
AND Longitude <= '-97.45285034179688’
AND MLSNum <>0
ORDER BY Area, ListPrice


The fact that many of your numeric values are in quotes concerns me. The fields in the db are numeric aren’t they? I’m not an expert on mySQL, but have more experience with MS SQL. When you use different types, some sort of conversion has to be done. And since you are using numeric logic, the fields in the table, and the inputs should be numeric.

How many records in the table. Are there any indexes on the table?

find/offer services free
Codes:THNMax ($97) THNMaxHDD (+100%) THNMaxBW (+100% txfr) THNMaxDomains (5 free) THNBalance (20% HD&BW, 1 Domain+IP +$16)


Thanks, the fields are numeric, I will correct the quotes and see if that speeds it up. There are about 10k records in the table and there are indexes on every field in the where statement.