On 13/05/2009 7:03 PM, Martin Pfeifle wrote: > Assume you have a table mytable(id, blob1, blob2,blob3). > You have a page_size of 1k and each blob is in average 20KBytes, i.e. a row > is of size 60KByte. > My question now is where does the projection of an sql-statement like "select > blob2 from mytable where id=777" take place. > Are all 60KBytes read from disk and filtered in the sqlite library or are > only 20KBytes read from disk?
http://www.sqlite.org/fileformat.html#overflow_page_chains Given the data layout (splitting the big row into an initial chunk plus one or more overflow pages is _not_ done on column boundaries, and the overflow pages are chained together on a linked list), your "only 20KB read from disk" scenario is not possible. It _may_ stop after reading up to the end of blob2. > Thus, from an I/O perspective is there a difference between the queries > "select * from mytable where id=777" and "select blob2 from mytable where > id=777". Have you considered running a few experiments? _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users