> > > > sqlite3BtreeData() actually reads a prefix of the data. > > Because of the way large blobs are stored (as a linked list > > of disk pages) you have to start reading at the beginning > > and read everything up to the point of interest. > > Random access for blobs would be ideal, but even a sequential block > fetching mechanism for blobs would be a useful SQLite API addition.
Just out of curiosity why is this data in the database? I've seen very few applications where the blob is indexed or operated upon by the database and it's always a pain to deal with it. We always just left binary data in the file system and stored references to it in the database.