MySQL Forums
Forum List  »  Performance

Re: Query optimize on large database
Posted by: james wang
Date: July 20, 2016 04:46AM

why not just:

SELECT d.owner_id, COUNT(*) AS kolvo
FROM data d
WHERE d.owner_id = @user_id
GROUP BY d.owner_id

?

I see no need to JOIN self here

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Query optimize on large database
326
July 20, 2016 04:46AM


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.