Hello Thomas,
you are right in principle: The gain should be not too great. However,
the number of calls to sqlite3_bind_text is <number of records> * <nuber
of columns>, which is *very* high.
Also, i suspect that sqlite3_bind_text makes a copy of the text i pass,
which could be eliminated too. Or am i wrong there?
Martin
Thomas Briggs wrote:
However, I would very much like a "bulk insert" - call to
sqlite (Oracle
OCI does this, for example), where i can put many (thousands)
of records
into the database with one call. Is there any chance of
something like
this ever to be added to sqlite?
I can't speak authoritatively, but I don't see what the impact would
be. Adding rows in bulk, with other databases, is mostly about
transferring the data more optimally and/or avoiding the SQL processing
engine. Both of those problems have already been solved by SQLite - you
can't get any more optimal than intra-process communication, and given a
prepared INSERT statement that is executed repeatedly, there is no SQL
processing engine involved.
It might be convenient to be able to provide arrays of inputs to a
prepared statement, but the only thing you'd gain performance-wise is
eliminating the function call overhead of all calls past the first, so
even that doesn't provide any serious benefit.
-Tom