SQLite Forum

Write large blob, > 2GB
Login
It *doesn't* need to read the whole row if it is only use some prefix
of the row.  But if you need the last column, then it needs to read
the whole row.  And a background process that is doing "VACUUM INTO"
needs to read the whole row.  Also, an UPDATE or INSERT needs to have
the whole row in memory as well.

If the K-th column is the right-most column in a row that you are reading, then
SQLite will only read in as much as needed to cover the first K columns.  So if
you have a bunch of small columns up front followed by a big blob, and you
read from the row but do not read the big blob, then the big blob is not
loaded into memory.  But if you have one small column *after* the big blob
and you need to read that one small column, then SQLite will probably read
in the big blob too.  (There are some optimizations whereby SQLite can sometimes bypass reading the big blob, but they do not always apply so you
shouldn't count on them.)