title: Update database table cyclically every 5 minutes
body: <p>I have to populate and update one of my MySql database table using a complex and expensive query, based on selection from other table's data. This table doesn't need to be always fully updated when i make a query on it, but i'd like to have a cyclic update every 5 minutes.</p>
  
  <p>This automatic update should be infinite and i need to be sure that it never stops.</p>
  
  <p>After some research, i've found some solution, but i don't know which is better for security and performance.</p>
  
  <p>One of these could be my goal:</p>
  
  <ol>
  <li>Don't create table and make complex query from php every time to get the desired result</li>
  <li>Create a php script that repeats cyclically and update table db, maybe using Cron Job.</li>
  <li>Update table using a sql event</li>
  </ol>
  
  <p>I think that first solution could be to expensive since query is complex and there could be many request every second, but the result is always updated. I don't have experience about Cron Job, so i can't know if it could be a good idea or not. For the third solution, i still don't have database privileges to run events, but i'd like to know if it could be a valid solution.</p>
  
  <p>All other solutions are welcome, thanks.</p>