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, artist.name, count(play.playId) as plays from charts.play play, charts.artist artist, charts.song 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.

--
Sabelo

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Close to a million records & query too slow
1918
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.