On Thu, Oct 29, 2015 at 10:20 AM, Jason H <jhihn at gmx.com> wrote: > > If I could ask a followup question. You made the statement "SQLite reads > that row of the table from storage, from the first column to the last > column needed by the SELECT, but perhaps not all the way to the end of the > columns in the row.", Given an example select that requires columns 2,3,5, > does this mean that column 4 is also read, or is column 4 be skipped? I > guess the question is I am assuming that a row is serialization of one or > more strings that are a serialization of a string preceded by their lengths > (i.e. [L|data] ), would SQLite do something akin to (using my 2,3,5 > example): > begin row read, read L1, seek L1, read L2, read L2*byte, read L3, read > L3*byte, read L4, seek L4, read L5, read L5*byte > or would the 'read L4, seek L4' be changed to 'read L4, read L4*byte' ?
You should consider reading https://www.sqlite.org/fileformat2.html , especially sections 2.3 "Representation Of SQL Tables" and 1.5 "B-tree Pages". If your project _really_ needs to know this level of detail, then you really should read up on the underlying system. Also maybe throw in https://www.sqlite.org/arch.html to get a broad feel of how things break down. -scott