Category Archives: batch-processing

php-mysql run query in background and get notified of result

I have a mysql query in a php script with lots of joins and conditions. When my database tables contain < 1000 rows, the query takes around a couple of minutes to execute. But when the tables contain 10000+ rows, the php script time outs.

I would like to know if there is a system where I can batch process a resource-intensive query from a php script and then get a notification afterwards. E.g. even if it takes an hour to complete and the user has closed the initiating script, the batch system should continue to run as a background process and then send a notification e.g. by mail or by executing another php script.

Any ideas?