Load data local infile - query is sloooow

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

Load data local infile - query is sloooow

Post by sandy771 » Mon 18 Jun 2007 09:18

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.

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Post by swierzbicki » Mon 18 Jun 2007 17:50

Try this :
Create a thread with a dedicaced TMyConnection object and use the TMySqcript object instead the TQuery.

ben
Posts: 119
Joined: Wed 17 Nov 2004 19:48

Post by ben » Tue 19 Jun 2007 09:15

Read my post

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

it will help you.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 19 Jun 2007 14:29

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.

Post Reply