However, I would be more inclined to look at your select statement and figure out why it takes 20 seconds to return. One of the EASIEST ways to cut down the return time on an SQL statement is using Limit. With my suggested AJAX usage (CGI::AJAX), you can then make additional calls to the database in the background to load up the rest of the data while the user looks at the smaller result set.
If you can prevent it, there is really NO reason to send a user 550 results when he really just cares about the top five lines.
Oh, and did I mention, no one likes reading through huge datasets.
To kill the select statement, you need to know the thread_id in mysql, and have the proper permissions to issue a kill command. You can then send a command through MYSQL to kill the select. Most times this requires PROCESS privileges that most shared db owners will not give you. If it's dedicated do what you want, it's your data to kill.
As of MySQL 5, you can use the KILL QUERY command to kill the current query that is running for your active connection. Kill first showed up in MySQL 4.1, and something similar is in 3.23 under "zapp" but I wouldn't touch that one...
--
In reply to Re: Cancel DBI Mysql request in a CGI script called with XMLHTTPREQUEST
by Devanchya
in thread Cancel DBI Mysql request in a CGI script called with XMLHTTPREQUEST
by joe_kool
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |