UnQLite Users Forum

Page Size

append delete ks

We're evaluating a few key/value db's for storing time series on an embedded device.

Running one of the examples gave a filesize that was a lot more than SumOf(RecordSize), and looking into the file we saw a lot of zero padding per page (default 4k), we even had pages with apparently only 1 record (and record size was fixed at 200 bytes).

With limited flash storage this is a showstopper for us - Is it possible to reduce the overhead? Limiting the page size to 512 would most likely help - but most likely not eliminate the problem of large amount of unused space in the file.

Reply RSS


append delete #1. devel


Yes, you could easily the page size to a power of two number (512,1024 or even 256), via the UNQLITE_DEFAULT_PAGE_SIZE compile directive as follows:

:: @devel added on 05 Jul ’16 · 09:01

Since UnQlite is a transactional datastore, we need to store a lot of meta data associated with your payload so that we ensure safety. This is the tradeoff. As I said, the only way to go without hacking the internal is to modify the page size as mentioned above.
Hope this helps.


(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Your friendly neighbourhood moderators: chm_at_symisc, devel_at_symisc