Re: Re: Addition to: Trouble with initdb when the #define NAMEDATALEN = 51
От
Peter Eisentraut
Тема
Re: Re: Addition to: Trouble with initdb when the #define
NAMEDATALEN = 51
Дата
Msg-id
Pine.LNX.4.30.0105121558500.757-100000@peter.localdomain
Ответ на
Список
Дерево обсуждения
Re: Addition to: Trouble with initdb when the #define
NAMEDATALEN = 51 "G. Anthony Reina" <reina@nsi.edu>
Lincoln Yeoh writes: > At 12:35 AM 5/12/01 -0400, Tom Lane wrote: > >BTW, 51 is a gratuitously wasteful setting --- given alignment > >considerations, any value that's not a multiple of 4 is pointless. > >(It should work ... but it's pointless.) > > Would n^2-1 or n*8 -1 be better than n^2 or n*8? The important issue here is the storage layout of the system catalog tuples. If you take a look you will see that in most tables the field after a name field is either an oid or an int4, both of which generally require 4-byte alignment. Since names are also 4-byte aligned you will waste up to 3 bytes in padding if you don't choose NAMEDATALEN a multple of 4. Note that the system will actually only allow NAMEDATALEN-1 characters in a name, maybe you were referring to that. -- Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter
В списке pgsql-hackers по дате отправления
От: Lincoln Yeoh
Дата:
От: Tom Lane
Дата: