Once a request has started execution, it cannot be suspended / interrupted. The only exception to this is at the database administration level, where you could essentially make the request stop (think of it as how to kill the current process on Windows if you want). However, you do not want to do this, so forget about it.
Your best option is to use the LOW PRIORITY chunked operation. Basically, this means that if a query in LOW PRIORITY takes too long to complete, think about how you could split it so that it is faster without creating lost data or illegal data in the database.
A very simple use case is an insert into which 10,000 new lines are inserted. By βbreakingβ the insert so that it performs the insert several times with smaller data sets (i.e. 500 at a time), each of them will complete faster and, therefore, will allow you to perform any operations other than LOW PRIORITY more timely.
how
Setting something as low priority is as simple as adding LOW_PRIORITY to the flag.
INSERT LOW_PRIORITY INTO xxx(a,b,c,) VALUES()
UPDATE LOW_PRIORITY xxx SET a=b
DELETE LOW_PRIORITY FROM xxx WHERE a="value"
Lee
source share