Re: determining maxsize for character varying

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: determining maxsize for character varying
Дата
Msg-id 11149.1182006428@sss.pgh.pa.us
обсуждение исходный текст
Ответ на determining maxsize for character varying  (okparanoid@free.fr)
Список pgsql-performance
okparanoid@free.fr writes:
> Hello i would like to know if not determining a max size value for a
> character varying's fields decrease the perfomance (perhaps size of
> stockage ?

No, more the other way around: specifying varchar(N) when you had to
pick N out of the air decreases performance, because of all the
essentially useless checks of the string length that Postgres has to
make.  If you cannot defend a specific limit N as being required by your
application, then just make it unconstrained varchar (or better text).

Do *not* use char(N) for data with highly variable width; that one
definitely will cost you performance and disk space.

            regards, tom lane

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

Предыдущее
От: Ragnar
Дата:
Сообщение: Re: determining maxsize for character varying
Следующее
От: "J6M"
Дата:
Сообщение: Re: Database size