On 2 Jan 2011, at 10:33pm, Alok Singh wrote: > i am doing the same inserting line by line using Transaction but its like > dead code as its very slow where as my system config is quite heavy then > also.
Sorry, I don't use your language so I can't help with your code. However, I do notice that a lot of the time taken by your application is in setting up parameters and binding them, and you do this separately for each cell. Also you are using a huge number of operations: one to INSERT each row, then one UPDATE for every value in every row. You only really need one INSERT for each row: assemble all the values in the row and put them all in in the same command. Also you are still using a 2D array to store your values. This is slow and requires a lot of memory. Instead, use one array to read in the first row (with the names of the columns) and then use a second 1D array for each row of values: read one line in then write the row out, then read the next line in. You should not need any 2D arrays in your code at all, and you will never hold the full file content in memory all at the same time. Just for testing purposes, try using the command-line tool to read the same .csv file. That should give you an idea how fast it's possible to read that file. If your own code isn't much slower then you are already doing a good job. Simon. _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

