MySQL Forums
Forum List  »  Performance

Re: MYSQL issues with query performance
Posted by: Peter Brawley
Date: June 29, 2020 02:55PM

Sorry, can't make useful sense of the unformatted queries.

The 2nd query has a redundant line ...
     AND xref_users_competences.deleted = '0'

The optimiser probably removed it, but just in case, lose it.

I wouldn't assume the 2nd query will be as fast as the first, or that a union of them will be as fast as either alone.

The optimiser can't find a useful index for xref_users_competences in the 2nd query so it's reading 128k rows in that table. Did you try a covering index like (users.id,deleted)?

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: MYSQL issues with query performance
196
June 29, 2020 02:55PM


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.