SQLite Forum

Increasing insert performance of an in-memory db
Login
Copying in memory might in this case be avoidable to some extend by using SQLite's [incremental BLOB I/O](https://www.sqlite.org/c3ref/blob_open.html).

Though there still seems to be room for further optimization: The SQLite API could provide

* a function `sqlite3_blob_write_from_io` (or other name) where a file descriptor is passed to SQLite. The function can then retrieve the data directly from the file into its memory, or,

* provide a pointer to its internal buffer and allow the user to fill it (using `read(fd, ...)` if it is directly from I/O represented by a file descriptor).

It seems to me that there is potential to boost insert performance in this case and perhaps many others.