sql - PHP scheduled task, which regularly summarizes the data in one data table every day and stores it in another form. Which method is better?
我想大声告诉你2017-05-27 17:41:55
0
1
534
I personally prefer to use stored procedures to complete the requirements. I don’t know if there are other methods because I am not very familiar with crontab
1. Write scheduled tasks and access PHP files within a specified time 2. To avoid excessive use of resources due to large amounts of data, limit the number of summaries, record the number of reads, and record the last ID. Create a temporary table, which contains the id of the last execution, the number of executions, and the execution time. 3. Use the transaction mechanism to ensure data integrity, establish a good transaction mechanism, and roll back the data in a timely manner due to problems in data saving or updating. Create a log file. Track bug issues
1. Write scheduled tasks and access PHP files within a specified time
2. To avoid excessive use of resources due to large amounts of data, limit the number of summaries, record the number of reads, and record the last ID. Create a temporary table, which contains the id of the last execution, the number of executions, and the execution time.
3. Use the transaction mechanism to ensure data integrity, establish a good transaction mechanism, and roll back the data in a timely manner due to problems in data saving or updating. Create a log file. Track bug issues