I wish to execute LOAD DATA LOW_PRIORITY INFILE
statement from Java.
I am dealing only with MyISAM engine.
I am interested if statement.execute("LOAD DATA LOW_PRIORITY INFILE ...")
will execute this query asynchronously, or will it block until this statement will be completed.
I am asking this since I have SQL operations after this statement that are based on the loaded data, but I am still interested that any read operation on this table that are executed concurrently will have higher priority over LOAD DATA
statement.
LOAD DATA LOW_PRIORITY INFILE ...
blocks until completion on the commandline, so I assume your code will block too.
If you want concurrent transactions to be able to read from your table during the import, then you want to use the CONCURRENT
option instead of LOW PRIORITY
.
As stated in the manual:
If you specify CONCURRENT with a MyISAM table that satisfies the condition for concurrent inserts (that is, it contains no free blocks in the middle), other threads can retrieve data from the table while LOAD DATA is executing.