I have this query:
Explain SQL_NO_CACHE select p.id as product_id, p.price_amount, p.is_male, p.is_female, p.is_accessories, p.is_contact_lens, c.id as color_id, b.name as brand, p.name, c.color, c.code, c.pohoda_sku, c.on_stock, c.not_send_to_kiosks, (p.is_active && !p.is_archive && c.is_active && !c.is_archive) as is_active, c.is_visible, c.abbr from product_colors as c left join products as p on p.id = c.product_id left join brands as b on p.brand_id = b.id order by c.on_stock desc
Why the query does not use index in first table? In phpmyadmin it durate 0.0708s, but on the web it is more than 1s. I do not want limit it by where or limit. Can I optimize this query or it is cause with some memory limit in php.ini or elsewhere?