Em 2 de abril de 2013 10:23, Marcelo da Silva <marc...@ig.com.br> escreveu:

>
>> >
>> > Tip: There are no performance differences between these three types,
>> apart from increased storage size when using the blank-padded type, and a
>> few extra cycles to check the length when storing into a length-constrained
>> column. While character(n) has performance advantages in some other
>> database systems, it has no such advantages inPostgreSQL. In most
>> situations text or character varying should be used instead.
>> >
>> > http://www.postgresql.org/docs/9.2/static/datatype-character.html
>> >
>> > Entendo que a diferença seria apenas de espaço em disco mesmo. Use
>> varchar e boa.
>>
>>
Strings de até 126 bytes têm 1 byte de overhead (para o tamanho da String);
strings maiores têm 4 bytes de overhead.
Não seria um ganho de velocidade se o PostgreSQL armazenasse strings de 2,
4 e 8 bytes em tipos unsigned?
Sei que existe o tipo "char" (com aspas) que fica armazenado em exatamente
1 byte.

-- 
Atenciosamente,
Alexsander da Rosa
_______________________________________________
pgbr-geral mailing list
pgbr-geral@listas.postgresql.org.br
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a