MySQL Forums
Forum List  »  Newbie

Re: Mysql sub query optimization
Posted by: Rick James
Date: July 05, 2014 12:18PM

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.

Options: ReplyQuote


Subject
Written By
Posted
July 02, 2014 03:33AM
July 03, 2014 02:02AM
July 04, 2014 01:01AM
Re: Mysql sub query optimization
July 05, 2014 12:18PM
July 09, 2014 02:42AM
July 06, 2014 11:30PM


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.