MySQL Forums
Forum List  »  Performance

Re: Slow join performance
Posted by: Rick James
Date: November 28, 2015 03:02PM

OK, you need the LEFTs. The reason for asking if they could be removed -- There are filtering criteria on 3 of the tables that come late in the EXPLAIN. If they could come first, then the query would probably run a lot faster.

As you have it (with LEFT everywhere), you are expecting 4M rows of output, correct? That, in itself, will take a long time. (Seconds, at least.)

I'm still puzzled at the logic -- When "ea2.address_type = 'Bil'", you get the address fields displayed in the output. When it is != 'Bil', you will get NULLs. This is not a typical way to do a WHERE clause. Usually you would want to skip the row completely. Please explain.

Perhaps the LEFT could (should) be removed from rn, be1, bea1, ea2 and make sure the indexes let the query start them them _before_ getting to the 4M-row psrl.

Options: ReplyQuote

Written By
November 27, 2015 04:55AM
Re: Slow join performance
November 28, 2015 03:02PM
February 25, 2016 06:22AM

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.