Take a look at the test_intarray.c/h extension located in the main source 
directory, it may just do what you want (the array of integers is stored in 
memory, but is accessed as a table).

https://www.sqlite.org/src/artifact/870124b95ec4c645


> -----Original Message-----
> From: sqlite-users-boun...@mailinglists.sqlite.org [mailto:sqlite-users-
> boun...@mailinglists.sqlite.org] On Behalf Of Eric Grange
> Sent: Thursday, 26 May, 2016 08:15
> To: General Discussion of SQLite Database
> Subject: [sqlite] Fastest way to add many simple rows to a table?
> 
> 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

Reply via email to