On 16/04/2009 5:47 PM, Martin Pfeifle wrote:
> Hi,
> we store proprietary organized data in blobs within an sqlite database.
> Assume you have a table mydata(id, attr1, attr2, blob). 
> The page size of the database is 1k.

This is the *default* page size. You can change it before you first put 
data in the db file.

> If you now store blobs in your table which are larger than 1k, 
> sqlite uses overflow pages and the content of the blobs is distributed 
> to several pages, right?

Not just blobs; if your row won't fit in a page for any reason, excess 
row contents are put into one or more overflow pages.

> Are the pages on which the blobs are stored
> consecutive or can they be distributed arbitrarily within the database file?

I imagine it would use pages off the list of free pages in preference to 
extending the size of the file ... try inspecting the source code.

 > Can two records share the same overflow page, or is an overflow page 
dedicated to one record?

My reading of the relevant section of 
http://www.sqlite.org/fileformat.html suggests the answer is dedicated 
... have a look and see if you agree. BTW there's lots of interesting 
bed-time reading in there :-)

> Is there a formal definition of the fragmentation value which is reported by 
> sqlite3_analyzer?

This was discussed briefly in this forum within the last few days ... 
AFAIK the only formal definition you will find is in the analyzer source 
code.

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

Reply via email to