How to filter the log data of large batches of users? for example, the table a & nbsp; is designed as follows: Table a & nbsp; is the basic information of million users (unique uid) uid, name, region, service provider .... table B & nbsp; each user has about 100 data records, that is, 100 million x 100.1 billion data records. Each piece of data contains uid, time1, time2uid, and time1 (user ID, start time, and close time). how can I filter log data of large volumes of users?
For example, million users
The table is designed as follows:
Table a is the basic information of million users (unique uid)
Uid, name, region, service provider ....
Table B has about 100 data records for each user, that is, 100 million x 100 = 0.1 billion million data records. Each data entry includes (user ID, start time, and close time)
Uid, time1, time2
Uid, time1, time2
...
Requirement: count the number of users in a 24-hour period and collect statistics based on a region and a service provider.
------ Solution --------------------
What are the number of users in a 24-hour period.
------ Solution --------------------
0.1 billion million data records are not large, but a reasonable index is required.
------ Solution --------------------
Do it once a day, and then put the statistical results into a table record. The next time you directly read the data from the table, you do not need to make statistics every time.
------ Solution --------------------
Reference:
Do it once a day, and then put the statistical results into a table record. The next time you directly read the data from the table, you do not need to make statistics every time.
Creating indexes and caching data are both an optimization method.