Re: How to find greatest record before known values fast - Mailing list pgsql-general

From Tom Lane
Subject Re: How to find greatest record before known values fast
Date
Msg-id 13509.1412377176@sss.pgh.pa.us
Whole thread Raw
In response to Re: How to find greatest record before known values fast  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: How to find greatest record before known values fast
List pgsql-general
Adrian Klaver <adrian.klaver@aklaver.com> writes:
>> page 28:
>>
>> Unlike    many
>> databases,    char(n)    is    NOT    stored    as    afixed-sizedfield
>> in    Postgres.    It    is    treated    exactly    the    sameas
>> varchar(n)except    for    being    padded

> Which directly contradicts the information on page 27:

This info is probably not as well worded as it could be, but it's not
really wrong.  The key point is that char(N) is blank-padded (thereby
wasting space) to be N *characters*, but that is not necessarily N
*bytes*, because of possible multi-byte characters.  Therefore the engine
has to treat it as a variable-length datatype.

I believe in some some other DBMSes, char(N) means N *bytes* and is
treated as a fixed-size datatype.  Dunno what they do with multibyte
encodings.

            regards, tom lane


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: How to find greatest record before known values fast
Next
From: Adrian Klaver
Date:
Subject: Re: How to find greatest record before known values fast