Joanne Pham wrote: > Hi All, > I have the file which has million rows of insert statement to insert the data > to the database like below: > insert into tables values(.......) > ................................ > (there are million insert statement to insert to the table) > (file name is insertTables) > Then I ran the following command to insert to table > sqlite3 MyDB < insertTables > For compeleting to insert 1 million rows it may take up to a day. Is there > any way to speech up the insertion in this case. > Thanks, > JL > > Hi, Joanne.
First of all, have you wrapped the insert sequence in a transaction? That speeds up things considerably. Second, try dropping all indexes on the table prior to insertion and recreate them after insertion is done. Third, make sure no complicated triggers run on insertion into that table. Other than that - are you perchance hosting the database on a flash medium, or generally a slow storage medium? Can you give us more details about the operating system environment and the table schemas? _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users