It depends in how you define "update the index".

If you mean "write to disk" then this happens "once, at the end of the 
transaction" (the exact process differs depending on the journal mode).

If you mean "change the index  structure in memory" then (as already noted) the 
changes will happen for each record touched.

For large batch updates, it may be faster to drop the index before performing 
the changes and recreate it afterwards.

-----Ursprüngliche Nachricht-----
Von: Baruch Burstein [mailto:bmburst...@gmail.com]
Gesendet: Donnerstag, 15. Jänner 2015 22:19
An: General Discussion of SQLite Database
Betreff: [sqlite] Inserting/removing large number of rows with index

Hi,

If I have a table with an index, and INSERT or DELETE a large number of rows in 
one statement, does sqlite stop to update the index for each record, or is it 
smart enough to update the index just once for all the changed records?

--
˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı 
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: h...@scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.


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

Reply via email to