Page 1 of 1

Load data local infile - query is sloooow

Posted: Mon 18 Jun 2007 09:18
by sandy771
I have an app where I create a reasonably large text file (about 0.5GB) and then load it into MySQL.

Whne the query is executed - the file loads, this takes a few minutes but the myQuery component a) freezes the app and b) once the file has loaded (i.e. task mamanger shows that the file is no longer being read) seems to habeg for about 5 minutes.

Any idea :

how i can speed this up?

how i can at least stop my application from freezing and disaply a progress message

Thanks.

Posted: Mon 18 Jun 2007 17:50
by swierzbicki
Try this :
Create a thread with a dedicaced TMyConnection object and use the TMySqcript object instead the TQuery.

Posted: Tue 19 Jun 2007 09:15
by ben
Read my post

http://crlab.com/forums/viewtopic.php?t=10000

it will help you.

Posted: Tue 19 Jun 2007 14:29
by Antaeus
I just want to refine previous answers. It is better to use in this case either the RestoreFromFile method of TMyDump, or the ExecuteFile method of TMyScript in a different thread.