MySQL Forums
Forum List  »  Performance

Re: Query optimization needed
Posted by: Peter Brawley
Date: November 05, 2015 11:40PM

The query needs to look at 28 * 861502 * 180518 = 4.4 trillion rows. For the two biggest contributors, the engine can find no index. That's not going to work.

Left joins don't optimise well, and join conditions with ORs don't optimise at all. Can you move that filtering elsewhere? Prepare an intermediate result table? I would keep moving those forks back to a preprocessing stage till the query looks reasonable to Explain.

That first left Join involves a table with 800k rows. Can you do with Inner Joins?



Edited 1 time(s). Last edit at 11/08/2015 04:14PM by Peter Brawley.

Options: ReplyQuote


Subject
Views
Written By
Posted
1740
November 05, 2015 01:42AM
Re: Query optimization needed
668
November 05, 2015 11:40PM
765
November 06, 2015 11:25PM
801
November 08, 2015 04:32PM
739
November 17, 2015 05:43AM
735
November 26, 2015 09:21PM


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.