duan7664 2010-12-13 14:52
浏览 13

使用日/周/月过滤热门项目

I am developing a website which will have 200.000 pages. There is also a browse section, which shows most popular, highest rated etc. documents. However this section will become almost static couple of weeks later, after launch. So I also would like to implement a filtering system which will show today's, this week's, this month's most popular items, just like youtube.

Just like this:

http://www.youtube.com/videos?c=2

How should I implement this function? Do I need another table, which will have a new entry for every document each day?

docid, date, view_count, rating

So I will get today's row for filtering by using a day, or calculate a week (7 rows) for filtering by using week? It seems not efficient. Do you have any suggestions?

I am using LAMP stack by the way.

Thanks,

  • 写回答

4条回答 默认 最新

  • douzhangjian1505 2010-12-13 14:58
    关注

    I guess I would calculate the date's in code and then pass them as arguments, to the SQL you are using.

    评论

报告相同问题?

悬赏问题

  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答