0

I want to insert data frames into sqlite table. The data frame contains thousands of rows. I am now using RSQLite package for database operation. For inserting data frame into table i am using dbWriteTable(conn, name, value, ...) method. But the repeated insertion to the table makes the program slower. Is there any other better option to insert data frame into a table? Thanks.

Dinoop Nair
  • 2,663
  • 6
  • 31
  • 51

1 Answers1

3

If you don't use explicit transactions, each SQL statement is wrapped into an automatic transaction. At the end of each transaction, the data is synchronized with the disk.

Wrap all inserts into a single transaction.

CL.
  • 173,858
  • 17
  • 217
  • 259