MySQL Forums
Forum List  »  Optimizer & Parser

Re: Close to a million records & query too slow
Posted by: sabelo simelane
Date: March 08, 2010 04:12PM

Could you also assist me with this query now based on the same schema.

select artist.artistId,, count(play.playId) as plays from play, charts.artist artist, song where (play.songId = song.songId) and (song.artistId = artist.artistId) and (date(play.dateAndTime) >= ?) and (date(play.dateAndTime) <= ?) and (artist.isLocal = ?) group by artist.artistId order by plays desc;

This query seeks to retrieve all artists with the most number of plays in the date interval.

Thank you in advance for your ingenuity.


Options: ReplyQuote

Written By
Re: Close to a million records & query too slow
March 08, 2010 04:12PM

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.