怎么对大批量用户日志数据统计筛选

WBOY
Release: 2016-06-13 12:29:40
Original
795 people have browsed it

如何对大批量用户日志数据统计筛选啊
比如 100W用户

现在表是这样设计的:
表a  是100W用户基本信息(uid唯一)
uid,name,地区,服务商....


表b 每个用户有100条左右数据,即100W*100=1亿数据。每条数据内容包括(用户ID,打开时间,关闭时间)
uid,time1,time2
uid,time1,time2
...

需求:统计24小时段用户数  并且可 根据某地区 and 某服务商 统计24小时段用户数 是指什么,举例说明一下。   

引用:
每日做一次,然后将统计结果放入一个表记录,下次直接重表中读取,不用每次都统计。


建立索引和将数据缓存起来都是个优化方法 每日做一次,然后将统计结果放入一个表记录,下次直接重表中读取,不用每次都统计。1亿数据不算多,但是要建立合理的索引。
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!