Re: [HACKERS] varchar/char size

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] varchar/char size
Дата
Msg-id 199801080317.WAA19073@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] varchar/char size  ("Thomas G. Lockhart" <lockhart@alumni.caltech.edu>)
Список pgsql-hackers
>
> > Does someone want to remind me why we allocate the full size for char()
> > and varchar(), when we really can just allocate the size of the given
> > string?
> > I relize char() has to be padded, but why varchar()?
>
> > In my experience, char() is full size as defined by create, and
> > varchar() is the the size of the actual data in the field, like text,
> > but with a pre-defined limit.
>
> Well, in many relational databases access can be optimized by having
> fixed-length tuple storage structures. Also, it allows re-use of deleted
> space in storage pages. It may be that neither of these points have any
> bearing on Postgres, and never will, but unless that clearly the case then
> I would be inclined to keep the storage scheme as it is currently.

With Ingres and Informix char() is fixed size, while varchar() is
VARiable size.

--
Bruce Momjian
maillist@candle.pha.pa.us

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Thomas G. Lockhart"
Дата:
Сообщение: Re: [HACKERS] varchar/char size
Следующее
От: "Thomas G. Lockhart"
Дата:
Сообщение: Re: [HACKERS] varchar/char size