On 22 Sep 2011, at 8:11pm, JM wrote:

> is the index updated after each insert/update/delete operation or is
> it updated after the transaction containing (many of) these operations
> has been committed? That way an insertion of many lines into the
> database would take time for index recreation only once, wouldn't it?

Indexes are not recreated from scratch unless you explicitly ask for them to be 
(rare).  If you open a database with a million rows in and add or change a row, 
the indexes for that table are each modified slightly to reflect the change.  
The amount of word done is a very little work because it was a very little 
change, not a lot of work because all the million entries have to be rewritten.

As to when the changes to the index are actually done, from the point of view 
of the program making the changes, they are done after each operation.  From 
the point of view of other programs with the same database open, they are done 
only after the transaction has been committed.

(The above explanation is simplified for clarity.)

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to