On 2017/08/14 9:29 AM, Simon Slavin wrote:

On 14 Aug 2017, at 7:52am, Clemens Ladisch <clem...@ladisch.de> wrote:

Wrap everything into a single transaction.
<http://www.sqlite.org/faq.html#q19>
and CREATE the INDEXes after doing the INSERTs:

BEGIN
     CREATE TABLE …
     INSERT …
     CREATE INDEX …
COMMIT

BEGIN
     SELECT …
COMMIT

This may not be the best solution for the OP who does many SELECTs in between the INSERTs, so those may become slow if not not supported by a good Index. It might well be not all the Indices are necessary from the start though, and, given the time he mentions, the selects might not affect the total time by much.



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

Reply via email to