Re: Mysql sub query optimization
What about oc_product_to_store ? Or is it a VIEW?
The dependent subquery is hampered by lack of index to help with
AND p2c.category_id = c.category_id
So, it started by collecting all the data:
2 DEPENDENT SUBQUERY p2s index PRIMARY PRIMARY 8 NULL 1111 Using where; Using index
and then filtering down to what is needed.
Perhaps adding this to p2c would speed it up:
INDEX(category_id, product_id)
I suspect the DERIVED form is also missing a useful index.
Subject
Written By
Posted
Re: Mysql sub query optimization
July 05, 2014 12:18PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.