On Sep 24, 2009, at 8:42 AM, Adam Panayis wrote:

> Hi, are there plans to stop sqlite3 from reading in all column data on
> specific select queries? i.e I would like sqlite to ONLY read column
> data for columns which are specified in the select and where clauses.

Short answer:  Already does that.

Long answer:  SQLite pulls content from the disk one page at a time.   
If all the data is on the same page (the common case) then all the  
data will always be read from disk.  There is no getting around that.   
If the row is large and does not fit on a single page, then SQLite  
strives to avoid reading any pages that are not actually needed.  That  
is already implemented.  Because of the file format, sometimes earlier  
pages must be read in order to find the location of later pages.  In  
other cases (when you have autovacuum set) SQLite is able to guess the  
location of later pages without having to read earlier pages.   SQLite  
never reads pages that follow what is needed.

Once the necessary pages are in memory, SQLite only looks at the  
specific parts of a row that are requested.  Unrequested columns are  
never extracted or decoded from the raw row data.

D. Richard Hipp
d...@hwaci.com



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to