Use transactions. Or batch mode.
Indeed, when we .dump a table from the sqlite3 console, one will see a very fast way to use the former. Sent from my iPhone > On May 26, 2016, at 10:15 AM, Eric Grange <zar...@gmail.com> wrote: > > Hi, > > I am looking for the fastest way to insert many rows to a simple table. > > By "simple" I mean a relation table (with just a couple integer/key fields) > or even a single-column (temp table used for filtering as an alternative to > a "in" literal), but I want to insert hundreds of thousandths of them as > fast as possible. > > The fastest I have found so far is to use an insert from a select with > json_each() used to provide the data. > Using multiple "insert into", even within a prepared statement within a > transaction is quite slower. > > The json_each approach would satisfy my need, but I am curious is there is > another approach that could be suggested? (without involving a custom > function) > > Eric > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users