Re: [PERFORM] Text/Varchar performance...

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: [PERFORM] Text/Varchar performance...
Дата
Msg-id 200510051200.48515.josh@agliodbs.com
обсуждение исходный текст
Ответ на Text/Varchar performance...  ("Cristian Prieto" <cristian@clickdiario.com>)
Список pgsql-general
Cristian,

> Hello, just a little question, It's preferable to use Text Fields or
> varchar(255) fields in a table? Are there any performance differences in
> the use of any of them?

TEXT, VARCHAR, and CHAR use the same underlying storage mechanism.   This
means that TEXT is actually the "fastest" since it doesn't check length or
space-pad.  However, that's unlikely to affect you unless you've millions
of records; you should use the type which makes sense given your
application.

For "large text fields" I always use TEXT.  BTW, in PostgreSQL VARCHAR is
not limited to 255; I think we support up to 1GB of text or something
preposterous.

--
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco

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

Предыдущее
От: "John D. Burger"
Дата:
Сообщение: Problems with group by ... order by
Следующее
От: Bricklen Anderson
Дата:
Сообщение: Re: Problems with group by ... order by