-2

I have 1 master table that contains the data fetched from the join of other 3 tables. Those three tables are updated very frequently.I want to schedule a cron job that will change only those rows That were updated in those three tables.

One way is to delete the master table and populate it again by running the sql query. But that is not efficient when I have to run the cronjob every 15 minutes and the number of rows in tables are in hundreds of thousands.

P.S. I am using php,mysql and cronjobs

James Z
  • 12,209
  • 10
  • 24
  • 44

1 Answers1

1

Create a view joining the 3 tables. It would avoid creating any table and updating it every time the other tables are updated.

Can you manipulate the table data in MySQL itself .If possible you can use triggers so that when any of the table data is updated, your master table will also be automatically updated.

Kaushik
  • 93
  • 7