Subject | Re: [firebird-support] CHAR Vs VARCHAR vs Smallint for storing int value from 0 to 255 |
---|---|
Author | Ann W. Harrison |
Post date | 2010-06-09T16:18:34Z |
I wrote
5, 1, 2, 3, 4, 5 - adding one more field adds one more byte
to the stored size.
extra field adds nothing to the stored length.
Cheers,
Ann
> CHAR(1) stores between 0 and 2 bytes on disk, depending on whatFive CHAR(1) fields with values of 1, 2, 3, 4, 5 appear as
> comes near it. Before storing bytes on disk, Firebird does a
> run length compression, adding count bytes. A positive <n> count
> byte means that the next <n> bytes appear in the string as they
> appear on disk - thus four CHAR(1) fields with values of 1, 2, 3,
> & 4 will appear as 4, 1, 2, 3, 4.
5, 1, 2, 3, 4, 5 - adding one more field adds one more byte
to the stored size.
> A negative <n> count meansFive CHAR(1) fields containing the value 2 appear as -5, 3, so the
> that the next value appears n * -1 times. Four CHAR(1) field that
> all have the value 3 will appear as -4, 3.
extra field adds nothing to the stored length.
Cheers,
Ann