所以我有一张表,我会像这样简化
AppId, Popularity, Date
1 50 2014-04-09
1 60 2014-04-08
2 45 2014-04-09
我想立刻获得一堆应用,这是他们最近的受欢迎程度。
我有这个查询谁在本地工作,但在生产(超过3分钟)
长期采取行动SELECT popularity,app_id FROM `popularity`
WHERE `app_id` IN (1..1000)
AND (`date` = (select max(date) from popularity s where s.app_id = app_id))
GROUP BY distribution_application_id
有没有办法优化它?