sql - Optimizing a MySQL Join Query? -


i have following query:

select *   products p  left join files f on f.contentid = p.productid          p.state = 'active' ,       p.price > 0 order p.created desc     limit 2200 

currently, query takes 1.7 seconds 2200 rows. don't understand is, why time not decrease when change limit 2200 10, , more importantly, can speed up?

try :

explain select *   products p  left join files f on f.contentid = p.productid          p.state = 'active' ,       p.price > 0 order p.created desc     limit 2200 

to see indexes need


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -