Re: A simple question about text fields

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: A simple question about text fields
Дата
Msg-id 677775.1623856129@sss.pgh.pa.us
обсуждение исходный текст
Ответ на A simple question about text fields  (Martin Mueller <martinmueller@northwestern.edu>)
Ответы Re: A simple question about text fields  (Gavan Schneider <list.pg.gavan@pendari.org>)
Список pgsql-general
Martin Mueller <martinmueller@northwestern.edu> writes:
> Are there performance issues with the choice of 'text' vs. varchar and some character limit?  For instance, if I have
atable with ten million records and text fields that may range in length from 15 to 150, can I expect a measurable
improvementin response time for using varchar(150) or will text    do just or nearly as well.  

There is no situation where varchar outperforms text in Postgres.
If you need to apply a length constraint for application semantic
reasons, do so ... otherwise, text is the native type.  It's
useful to think of varchar as being a domain over text, though
for various reasons it's not implemented quite that way.

            regards, tom lane



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

Предыдущее
От: Martin Mueller
Дата:
Сообщение: A simple question about text fields
Следующее
От: Alexey Bashtanov
Дата:
Сообщение: Streaming replication: PANIC on tertiary when secondary promoted