The 256.B length limit for value strings was a barrier to many
possible applications for WB. The
procedures in wbscm.c work with value strings up to 64770.B in
length (see SCM Record Operations).
For a value string of length L:
The value string is stored literally with given key.
The first 255 bytes of the value string is stored literally with the given key. Successive 255 byte chunks of the value string are stored as L/255-1 sequential key-value pairs. The key for each chunk is the given key with the index byte 1 <= k <= 254 appended to it.
Note that use of bt:scan is complicated by long value strings.
The rest are proposed extensions to unlimited value string length.
The b-tree value fields points to a type datalong 1 block, which contains the value.
The bsiz argument to
make_seg() or block-size
make-seg is the size of all WB blocks (pages) in
Value points to head of a chain or tree of datalong blocks. Retrieved value assembly limits practical size. Storage efficiency is good for L >> bsiz.
An interesting variant is to have two trees, one for datalongs and the other for everything else. If the two trees are in separate segments (stored in separate files), then the datalong segment blocksize can be optimized without impacting speed for non-datalong operations.
Value designates external file containing data. storage efficiency is good for L >> bsiz. Retrieved value needs no assembly; use mmap().
This option requires a new type of WB block having the usual 20-byte header and a 2-byte length field. Each block would hold up to bsiz-20 bytes of data.