Home > Article > Backend Development > How to implement statistics on the number of tasks this month and this week when the amount of data is large?
Do I need to create two tables for this month and this week to record the number of tasks per month and week? Does anyone know, please help.
Do I need to create two tables for this month and this week to record the number of tasks per month and week? Does anyone know, please help.
Same question, if there are multiple tables, they need to be operated asynchronously, and the data of each table needs to be added and updated. Don’t know if it’s appropriate
How big the amount of data is? I think it can be considered in the secondary business table primary key ID
.
If we maintain two more tables, when will they be updated? Maintenance of statistical tables will affect business processes.
1. Write the data of the last month to the Redis List
2. Write a script that runs automatically in the early morning, remove the first element in the list, and insert the day’s tasks to the end of the list
3. The above scenario Suitable for tasks in the last month and week
Portal
If it is a hard-written month instead of the last 30 days, when writing the table, index the year/month/week number