I have the following query:
select *
from products as p
left join files as f on f.contentid = p.productid
where
p.state = 'active' AND
p.price > 0 order by p.created DESC
LIMIT 2200
Currently, this query takes about 1.7 seconds for 2200 rows. What I don’t understand is, why does this time not decrease when I change the limit from 2200 to 10, and more importantly, what I can do to speed it up?
Try :
to see what indexes you need