MySQL Forums
Forum List  »  Optimizer & Parser

Re: Optimize subquery, replace IN() with JOIN
Posted by: Rick James
Date: November 17, 2016 08:11PM

See if the comes closer to working:

    SELECT, a.title, a.alias
        FROM  content AS a
        WHERE =1842
          AND  EXISTS
            SELECT  *
                FROM  category_content_se
                WHERE  content_id =
                  AND  content_typ = 'actual' 
        ORDER BY  a.date_add DESC
        LIMIT  10;

    content: INDEX(id, date) -- in this order
    category_content_se: INDEX(content_id, content_typ) -- in either order

Options: ReplyQuote

Written By
Re: Optimize subquery, replace IN() with JOIN
November 17, 2016 08:11PM

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.