【发布时间】:2011-10-20 13:02:10
【问题描述】:
我一直在尝试找出一种处理此类排名系统的好方法。作为一个粗略的例子,我想查询一个 facebook 页面并获取每个帖子的喜欢和 cmets。然后,将基于时间间隔进行三个排名。举个简单的例子:
Hourly
- I pull all the posts updated within the last hour, and compare the # of likes/comments compared to my previous entry (the last pull being an hour prior).
Daily
- I pull down all posts within a 24 hours date range. I compare the # of likes/comments compared to the previous entry. "Post X had 12 more likes and 40 more comments today compared to yesterday"
Weekly
- I pull down all posts within a week's range and do the same as above. "Post X had no new likes, but 10 more comments added this week compared to last week"
就数据库表而言,什么是处理这个问题的好方法?有一张带有帖子(标题、cmets_previous、cmets_current、likes_previous、likes_current 等)的巨型表格是否有意义?
谢谢!
【问题讨论】: