I have a single table with quite a lot of columns, and 15,500 rows. I'm running the following query:
1 * IF( currency =1, price, IF( currency =2, price * 0.6959, 0 ) ) AS price,
ad.template_cache_2 AS template_cache
FROM tp_ad AS ad
AND action_type =0
ORDER BY `timestamp` DESC
LIMIT 0 , 10
The data being returned -
adid - INT
price - INT (needed in case price is in a HAVING clause if the user specifies a price)
template_cache - a template in which the ad is placed, LONGTEXT, about 2000 characters.
Indexes on status and action_type.
This query takes on average 0.25 - 0.30 seconds. I would really like to reduce that to a much smaller number, at least 3 times, I feel like 0.3 secs for some query is too much, but I honestly don't know where to start. Any help?