Subject | Re: [firebird-support] Varchar size overhead |
---|---|
Author | Alexandre Benson Smith |
Post date | 2009-01-21T15:37:48Z |
Hi Douglas !
Douglas Tosi wrote:
In your case you have 1968 trailing spaces for record, so you would have
4 chunks of 512 spaces (in fact 3 chunks of 512 and the other of 432),
this would put an overhead of 8 bytes per record on your varchar(2000)
column,
The other with the length of 100 would have just 2 bytes to represent
the 68 trailing spaces, a difference of 6 bytes per record
see you !
--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br
Douglas Tosi wrote:
> Hello!FB can compress 512 bytes to 2 if they are the same...
>
> Today while doing some tests I noticed something odd:
> Suppose the following tables with varchar fields of different sizes:
> create table test1(t1 varchar(100) character set ascii)
> create table test2(t2 varchar(2000) character set ascii)
>
In your case you have 1968 trailing spaces for record, so you would have
4 chunks of 512 spaces (in fact 3 chunks of 512 and the other of 432),
this would put an overhead of 8 bytes per record on your varchar(2000)
column,
The other with the length of 100 would have just 2 bytes to represent
the 68 trailing spaces, a difference of 6 bytes per record
see you !
--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br