Load Data from a big yaml file is very slow [message #38021] |
Wed, 24 October 2007 11:02  |
|
Hi,
I have a big problem, i want to load data from a big yaml file, 80 000 lines for 15 tables, but it's very slow, 35min by web, and indetermined by cli because i stop it after 60min.
Also I get the impression with the cli loop ???
Apparently, the first query to the database runs after 20min,by web, why is this taking so long?
If you already meet the problem or idea for optimized, I thank you in advance.
Greg
[Updated on: Wed, 24 October 2007 11:03]
|
|
|
|
|
| Re: Load Data from a big yaml file is very slow [message #38098 is a reply to message #38056 ] |
Thu, 25 October 2007 10:50   |
|
I don't know.
I use a sfPropelData::loadData method, I suppose that it use spyc by default, But I will watch.
Otherwise, is there a real difference between the two?
thanks.
|
|
|
|
| Re: Load Data from a big yaml file is very slow [message #38101 is a reply to message #38100 ] |
Thu, 25 October 2007 11:03   |
|
Ok
I look which is used
If it is spyc I try to integrate syck
|
|
|
| Re: Load Data from a big yaml file is very slow [message #38104 is a reply to message #38101 ] |
Thu, 25 October 2007 11:35   |
|
is what Syck is available under windows?
If yes where ? please !!!
|
|
|
|
| Re: Load Data from a big yaml file is very slow [message #38107 is a reply to message #38021 ] |
Thu, 25 October 2007 11:52   |
halfer Messages: 9514 Registered: January 2006 Location: West Midlands, UK |
Faithful Member |
|
|
I don't think it has ever been available for Windows, unless you are prepared (and can) compile it yourself.
Remember Palestine
|
|
|
|
| Re: Load Data from a big yaml file is very slow [message #38135 is a reply to message #38120 ] |
Thu, 25 October 2007 18:05   |
|
ok
But the data in the database are crypted, and I export decrypted.
But thanks anyway
I look if I can do some things with syck on windows
|
|
|
|
| Re: Load Data from a big yaml file is very slow [message #43302 is a reply to message #38021 ] |
Sun, 13 January 2008 01:23   |
lionslair Messages: 89 Registered: October 2007 Location: Perth / Western Australia |
Member |
|
|
Did you have any issues exporting data such as blog entries and the like? How did you escape the data so as not to cause issues when reading the yml file back into the import?
www.lionslair.net.au
|
|
|
|
| Re: Load Data from a big yaml file is very slow [message #43314 is a reply to message #43313 ] |
Sun, 13 January 2008 12:05   |
lionslair Messages: 89 Registered: October 2007 Location: Perth / Western Australia |
Member |
|
|
| indeyets wrote on Sun, 13 January 2008 19:32 |
| lionslair wrote on Sun, 13 January 2008 03:23 | Did you have any issues exporting data such as blog entries and the like? How did you escape the data so as not to cause issues when reading the yml file back into the import?
|
it should just work. Syck takes care about escaping
|
Yes I ended up using this class. I actually copied it and re-named it so it5 stopped printing ---- when it was not a new file rather a new record. This then formatted the fields I was having trouble with then it worked.
www.lionslair.net.au
|
|
|
|
|
| Re: Load Data from a big yaml file is very slow [message #46065 is a reply to message #45970 ] |
Thu, 21 February 2008 16:03  |
jillelaine Messages: 228 Registered: January 2008 Location: West Coast |
Faithful Member |
|
|
It is not a 'symfony way', but if you have MySQL as your database, and you have a large amount of data to import, you can use the LOAD DATA LOCAL INFILE with a .csv or .txt file. http://dev.mysql.com/doc/refman/5.0/en/load-data.html
I use this to import regularly from an Oracle database to MySQL. I created a file upload form where I set the parameters of the upload (fields terminated by, etc). It is VERY fast: I can import thousands of lines in only a few seconds.
But be aware, LOAD DATA INFILE does NO data validation: it will load NULL values into non-NULL columns, and blindly truncate any data that is too large for the field. Yet, if you do some data validation of your incoming file (count number of columns in each row, etc), and are prepared to find and fix bad rows, this method is very useful for large imports.
|
|
|