Fastest way to load records

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

Fastest way to load records

Post by sandy771 » Tue 02 Dec 2008 18:43

I have a database with about 5 million rows and a dozen columns 6 of the columns are strings the rest integers. At the moment I am loading them using the MySQL "load data local infile" function but I am wondering whether this is the best way.

Would TMyLoader be a better option? and if so is there an example of its usage?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 03 Dec 2008 11:56

TMyLoader serves for fast loading of data to the server. You can look at the example of using TMyLoader in MyDacDemo.
If you keep source data in a text file then quicker way is using the TMyBackup component.
You can find more detailed information about these components in the MyDAC help.

sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

Post by sandy771 » Wed 03 Dec 2008 15:22

I have looked at the MyLoader help files and it suggests using MyBackup - this would suit me well as my data is loaded from a text file.

However it order to determine the format of the data in the text file (I can't find reference to it anywhere in the help) I modified my program to first save the tables to a temporary folder. I changed to mode to bmtext and the path to C;\temp, but I get the error message "Can't create/write to file c:\temp\cases. The folder c:\temp exists - cases is one of the tables in the database.

Any ideas?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 04 Dec 2008 15:09

TMyBackup works on the server side, therefore the Path property specifies a path on the server where data files will be stored.
If you want to store or load the database in a file as a script you should use the TMyDump component. TMyDump works on the client side.

Post Reply