[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MySQL 5 is 25% slower then 4.1


Chenzhou Cui wrote:

The file is in fix column width format. If it is in CSV format, I don't need a program to read it.

'load data infile' can import from a fixed-width format. Check the documentation. I've set up a number of these imports, and they're a little messy to set up ( you have to put details of the widths of columns IN THE TABLE DEFINITION, but it does work.

What I do is create a temporary table with the column widths in the table definition, 'load data infile' into it, and then use a 'insert into ___ select * from ___' query to move the data into the real table. If you've got a lot of rows, then maybe this isn't such a good idea, but you can *probably* get your column widths into your table without causing too much trouble.

Importing from fixed-width columns really is the weakest part of 'load data infile'. Perhaps a feature-request bug for a better solution is in order?

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: suppressed
website: http://www.nusconsulting.com.au

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.