Re: Faster data type for one-length values

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: Faster data type for one-length values
Дата
в 11:17:20
Msg-id
20197.1179929832@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
Faster data type for one-length values André Volpato <andre.volpato@ecomtecnologia.com.br>
Re: Faster data type for one-length values Tom Lane <tgl@sss.pgh.pa.us>
Re: Faster data type for one-length values André Volpato<andre.volpato@ecomtecnologia.com.br>
Re: Faster data type for one-length values André Volpato<andre.volpato@ecomtecnologia.com.br>
Re: Faster data type for one-length values Alvaro Herrera <alvherre@commandprompt.com>
Re: Faster data type for one-length values Ron Mayer <rm_pg@cheapcomplexdevices.com>
Re: Faster data type for one-length values Lew <lew@nospam.lewscanon.com>
=?ISO-8859-1?Q?Andr=E9_Volpato?=  writes:
> I need to store one-length values like '1', '2', '3' or '4' .

> Today, this field is indexed with btree and is of type smallint (int2). 
> How much performance will be improved if I change it to "char" (1 byte 
> length) ?

The improvement will be zero.  Because of alignment restrictions, you
don't save any space from making an index entry smaller than 4 bytes.

If you have several such fields adjacent in a table row, making them all
narrower can save space, but it doesn't help for standalone index
entries.

			regards, tom lane
В списке pgsql-general по дате отправления
От: Richard Huxton
Дата:
От: bruce
Дата:
Сообщение: deleting/dropping tables...
FAQ