search

Home  >  Q&A  >  body text

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?

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

我想大声告诉你我想大声告诉你2763 days ago545

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-05-27 17:43:55

    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

    reply
    0
  • Cancelreply