MySQL Forums
Forum List  »  Performance

Re: How can I improve this table and query
Posted by: Øystein Grøvlen
Date: February 17, 2016 08:51AM


Does adding an index on products(brand) help?
Both the original plan, and the new one you got, will have to check all rows of transaction_data. I am thinking that in order for the query to execute faster, you need some way to access only a subset of the transactions. With an index on brand, the optimizer will hopefully decide to process the products table of the subquery first. That should hopefully reduce the amount of data that need to be accessed since only rows for the given brand will be joined with the other tables.

Øystein Grøvlen,
Senior Principal Software Engineer,
MySQL Group, Oracle,
Trondheim, Norway

Options: ReplyQuote

Written By
February 17, 2016 04:49AM
Re: How can I improve this table and query
February 17, 2016 08:51AM

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.