I have a simple schema and a sql loader that fills a table with initial values:

  delete from foo;
  insert into foo ...;
  insert into foo ...;
  ... about 50 inserts ...

To my surprise, the execution of these inserts took a few seconds (SQLite is 3.3.3). However, if I wrapped the entire loader in a transaction:

  begin transaction;
  delete from foo;
  insert into foo ...;
  insert into foo ...;
  ... about 50 inserts ...
  commit transaction;

then it was immediate. Why?

-- fxn


Reply via email to