I should have mentioned, I get data in a text file, Pipe Seperated, Double Quotes Qualifiers, Eg. "col1"|"col2"|"col3" ............................
I tried Load Datafile, Didn't work for me, It skips an additional left most character from Col1, So I get 'ol1' instead of 'col1'
..so as of now, I am importing into Access, Then using JDBC to select from Access, And then insert into Mysql.
Argghhh! :)
If you could tell me what the exact syntax is for Load Data Infile, with any possible things to keep in mind, would be awesome, Thanks in advance
I always use Load Data Infile to load data into MySQL tables. I may load anywhere from a few thousand rows to 8 million and occasionally 100 million rows.
Here is some sample syntax for Windows:
load data infile "TextFileName" REPLACE into Table Table1
fields terminated by "," optionally enclosed by '"' lines terminated by "\r\n"
(col1, col2, col3 ... col99);
Of course make sure the column list matches the columns in TextFileName.
I use Replace so if the primary/unique column values already exist, it will be replaced. You can also use Ignore to ignore the row when a row already exists with the same unique index/primary key.
Mike
-----Original Message----- From: mos [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 25, 2004 7:57 PM To: [EMAIL PROTECTED] Subject: Re: Speeding up Inserts
At 08:55 AM 5/25/2004, you wrote: >Hi All, >Whats the fastest way to speed up inserts? >I have a table which I insert into once a week (about 20-30k Rows) And >select from all the time... > >Is the only way to speed up inserts to remove indexes? >And to speed up selectes, ...add the indexes again? > >Regards, >Amit Amit, Use Load Data Infile if the data is coming from a text file. To load 30k rows should take a few seconds.
Mike
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]