Re: Which is faster: char(14) or varchar(14)

Поиск
Список
Период
Сортировка
От Edson Richter
Тема Re: Which is faster: char(14) or varchar(14)
Дата
Msg-id BLU0-SMTP115E32A64FFF8ACBF2D018ECF470@phx.gbl
обсуждение исходный текст
Ответ на Re: Which is faster: char(14) or varchar(14)  (hari.fuchs@gmail.com)
Ответы Re: Which is faster: char(14) or varchar(14)
Список pgsql-general
Em 04/12/2012 14:59, hari.fuchs@gmail.com escreveu:
> Edson Richter <edsonrichter@hotmail.com> writes:
>
>> In this specific case, the full length (14) is mandatory... so seems
>> there is no loss or gain.
>> Also, I see all varchar(...) created are by default "storage =
>> EXTENDED" (from "Pg Admin"), while other datatypes (like numeric,
>> smallint, integer) are "storage = MAIN".
>> Can I have a gain using fixed length datatype in place of current
>> varchar (like "numeric (14,0)")?
>> Or changing to "char(14) check length(doc)=14" and "storage=MAIN"?
> Sounds like premature optimization to me.  I'd first express what I want
> as clear as possible, e.g. "CREATE DOMAIN BrazilianCompanyId AS char(14)",
> and try to spot and fix performance problems when I'm done with all that.
>
>
>
Actually, I already stressed performance over these fields (query
optimization, indexing, reverse indexing, full text index inside
PostgreSQL and outside PostgreSQL, etc).
At current stage, I'm just looking for finetuning. Maybe storage is one
possibility.
It's already established database that I can't make big changes (even
changing from varchar to decimal or bigint would not be possible because
of leading zeroes).

Thanks for all that provided hints! I've learned a lot with you all.

Regards,

Edson


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

Предыдущее
От: hari.fuchs@gmail.com
Дата:
Сообщение: Re: Which is faster: char(14) or varchar(14)
Следующее
От: icholy
Дата:
Сообщение: libpq error message deallocation