On 10/30/15, Mark Hamburg <mhamburg.ml at gmail.com> wrote: > >> On Oct 29, 2015, at 12:24 PM, Richard Hipp <drh at sqlite.org> wrote: >> >> If you do have large BLOBs or strings, SQLite handles this best if the >> large blob/string is stored in a table by itself and then linked into >> other tables using an integer primary key. For example: >> >> CREATE TABLE BigBlobTab ( >> blobid INTEGER PRIMARY KEY, >> content BLOB -- big BLOB or text field. >> ); >> CREATE TABLE OtherStuff ( >> field1 VARCHAR(10), >> field2 FLOAT, >> field3 BOOLEAN, >> blobid INT REFERENCES BigBlobTab >> ); > > Will SQLite rewrite the whole row if you just change field2 from one float > to another? >
Yes. Not just the whole row but the whole page on which that row resides. And even if SQLite did just try to write the 8 bytes that changes, your OS and disk controller will both end up writing the entire sector and/or track, so it amounts to about the same I/O either way. -- D. Richard Hipp drh at sqlite.org