MySQL Forums
Forum List  »  Optimizer & Parser

Re: Query using "ref" instead of "range" access
Posted by: Rick James
Date: July 11, 2009 09:57PM

Is the stored procedure faster or slower?

See if this works any faster:
SELECT SQL_NO_CACHE scores.lid, scores.score,
   ( SELECT COUNT(s2.score)+1
          FROM scores AS s2
          WHERE s2.lid=scores.lid
            AND s2.score>scores.score )
    FROM scores
    WHERE scores.pid=186359
   GROUP BY scores.lid;

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Query using "ref" instead of "range" access
1934
July 11, 2009 09:57PM


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.