Hello,
A week of work on and my sloq query log is still full.
Here's my table structure:
id int(10) UNSIGNED
product_id varchar(6)
num_people tinyint(2)
start_date date
duration tinyint(2)
old_price float(6,2)
new_price float(6,2)
unit_code varchar(4)
discount float(6,2)
area varchar(30)
zone varchar(25)
prod_name
prod_desc text
spec_code varchar(8)
name varchar(50)
features text
main_description text
dateAdded date
has_extras tinyint(1)
Current size: 588,000 Rows
Here's my indexes:
id A 588925 NULLNULLBTREE
start_date 1 start_date A 215 NULLNULLBTREE
duration 1 duration A 4 NULLNULLBTREE
unit_code 1 siteCode A 489 NULLNULLBTREE
num_people 1 sleeps A 9 NULLNULLBTREE
prod_name 1 siteName A 489 NULLNULLBTREE
has_extras 1 hasHotTub A 1 NULLNULLBTREE
This is a query that takes 40 seconds:
SELECT start_date,old_price,new_price,spec_code,num_people,duration,spec_code FROM hoseasons_cache
WHERE product_id = 'LP5454'
AND start_date BETWEEN '2012-05-01' AND '2012-05-31' AND duration IN ('3','4','7');
What should I do? Would smaller tables with JOIN be faster?
Any help is very much appreciated.