Hi,
I am running some queries in my database and want to increase the performance and have created some indexes but I still think that the response time is to great so I want to see if I can create a better or another index to increase the speed.
My schema for the table I think has the biggest bottleneck look like this:
R_D( **id** int not null, **SDD** date not null, numa int, numt int, price decimal,
FOREIGN KEY (room_type_id) REFERENCES R_T (id)
What is interesting is the SDD attribute which contains dates (e.g. 2010-05-20) and in my query I make a range search like this: SDD >= '2010-05-03' and SDD < '2010-05-08'
The index I have, which indeed increase the performance, is
INDEX sdd ON R_D (SDD, numa, numt, price, id)
The problem is when I make a range search with a great distance like 2010-05-03 and 2010-06-04 it takes about 6-10 seconds to perform the query and I would really like to tune it.
I tried several indexes and even a cluster index on SDD, but the best result I’ve got is so far the index above.
Any advice would really be appreciated.
Sincerely
Mestika