SQLite Forum

Memory spike with zeroblob
Login
SQLite tries to optimize memory usage by not allocating zero bytes that
occur at the end of a record.  So a zeroblob() at the end of a record does
not require a memory allocation.  However, you have a few additional non-zero
bytes that follow your big zeroblob, and so SQLite is compelled to allocate
space for the entire thing.

Much less memory would be required if you exchange the order of the b
and p columns.