Page 1 of 1
Fastest way to load records
Posted: Tue 02 Dec 2008 18:43
by sandy771
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?
Posted: Wed 03 Dec 2008 11:56
by Dimon
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.
Posted: Wed 03 Dec 2008 15:22
by sandy771
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?
Posted: Thu 04 Dec 2008 15:09
by Dimon
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.