Subject | Re: [firebird-support] Varchar size overhead |
---|---|
Author | Ivan Prenosil |
Post date | 2009-01-22T11:37:04Z |
"Ann W. Harrison" wrote:
thus allowing to compress up to 128 same bytes into two.
(can "-1" be used as repeat count ??)
Ivan
>>> 2.) 127 ->2 (from a friend)...
>>> 3.) 128 -> 2 (Ivan)
>>> 4.) 256 -> 2 (Ann Harrison, message below),
> When a record is stored, it is first buffered at its fullAnd the range of values in one signed byte is -128..127,
> declared length - meaning that a varchar 1000 used 1002
> bytes, a char 1000 uses 1000 bytes, a double uses 8 bytes,
> etc.
>
> Then firebird does run length compression on that buffer.
> The first byte is a count. If it's positive <n>, it means
> that the next <n> bytes are part of the record. If negative,
> it means that the next byte is to be replicated <n * -1>
> times.
>
> Thus the string "abcddddef" becomes <3>abc<-4>d<2>ef
thus allowing to compress up to 128 same bytes into two.
(can "-1" be used as repeat count ??)
Ivan