I want to know how we can run a sql query in the background ... I have a big query that takes so long. I want to run this as a background so that the loading time of my page is less.
Run the request in a PHP script using cron and cache the result.
AJAX. , PHP , AJAX script PHP , . , , JavaScript . , , , .
, , .
http://dev.mysql.com/doc/refman/5.0/en/table-locking.html http://dev.mysql.com/doc/refman/5.5/en/insert.html.
mySQL :
INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [INTO] tbl_name [(col_name,...)] {VALUES | VALUE} ({expr | DEFAULT},...),(...),...
INSERT LOW_PRIORITY INTO tablename (column1,column2) VALUES ("hello","you");
CRON Cache AJAX.
CRON Cache , . .
AJAX, , , . , , , .
PHP , . linux CRON Windows Else Ajax request