Hi Richard,

assume I have a table mytable (id, blob1,blob2,blob3,blob4) 
where each blob extends over several pages.

Then I do the following SQL command:
select blob4 from mytable where id = 4711

Do I understand you correctly that in the case autuvacuum =true, 
the pages covered by blob1 to blob3 are not read from disk,
whereas in the case autovaccum=false they are also read from disk into main 
memory?

Martin 

 



________________________________
Von: D. Richard Hipp <d...@hwaci.com>
An: General Discussion of SQLite Database <sqlite-users@sqlite.org>
Gesendet: Donnerstag, den 24. September 2009, 14:58:16 Uhr
Betreff: Re: [sqlite] Sqlite reading all column data on selects.


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



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

Reply via email to