SQLite Forum

can I insert an 8GB file into sqlite?
Login
> Without using the blob_open, blob_read and blob_write functions, I can access large files stored in sqlite using substr on BLOBs piece-wise (for streaming to a web page).

Although a BLOB value can be quite large, I don't think SQLite is capable (I'd be happy to be corrected!) of super-efficiently seeking to a random offset within it. That is, `substr()` or `sqlite3_blob_read()` with a random offset *k* is liable to take *O(k)* time (although it may be faster than that in some cases). This is because of how SQLite internally splits the blob into a linked-list of fixed-size pages in the database file, which it has to traverse in order to find the desired offset.

That's another reason, in addition to those you go on to mention, why you probably want an application-level mechanism for splitting a huge file into BLOB chunks stored across multiple rows. I have an idea for a [virtual table](https://sqlite.org/vtab.html) extension to handle this in a general way, but haven't gotten to it!