For batch loading via script, you should limit the number of values per statement (SQLite compiles each statement into memory) and per transaction (SQLite needs to write to disk after a certain number of pages are modified).
For batch loading via program, you can prepare the insert statement for 1 row once and bind the values for ech row to be inserted.
Von: sqlite-users [mailto:[hidden email]] Im Auftrag von Grincheux
Gesendet: Sonntag, 01. September 2019 08:28
An: [hidden email] Betreff: [EXTERNAL] [sqlite] INSERT vs BEGIN
I want to insert 1 000 000 records.
The other manner tot do is creating a transaction with one insert command by line.
My question is what is the best thing to do ?
Or having a transaction for the first sample?
One must know that I am obliged to use "BEGIN DEFERRED TRANSACTION" because others threads needs to access to tables.