Hi guys, just wondering if anyone can offer me a bit of advice.
I've recently built an SQL statement which is built on the fly, upon testing the statement I am experiencing very long query times of anything up to around 2 minutes once it is put live!!!
The SQL I am querying with looks something like this:
SELECT * FROM villas, pricing WHERE villas.resort = 'cala_dor' OR villas.resort ='pollenca' AND villas.beds LIKE '%%' AND pricing.week = '1085180400' AND pricing.price != '0' AND pricing.price LIKE '%%' AND pricing.availability = '1' AND villas.id = pricing.id GROUP BY villas.id ORDER BY villas.owner DESC, villas.beds ASC
[code]
I have set up indexes on:
Villas > Resort, Beds
Pricing > Week, Price, Availability
Does anyone have any ideas why it could be taking so long to run???