How can we run sql query in background?

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.

+5
source share
5 answers

Run the request in a PHP script using cron and cache the result.

+3
source

AJAX. , PHP , AJAX script PHP , . , , JavaScript . , , , .

, , .

+3

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");
+2

CRON Cache AJAX.

CRON Cache , . .

AJAX, , , . , , , .

+2

PHP , . linux CRON Windows Else Ajax request

0

All Articles