Re: 1 char in the world

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: 1 char in the world
Дата
Msg-id 5513.1043884766@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: 1 char in the world  (Matt Mello <alien@spaceship.com>)
Список pgsql-performance
Matt Mello <alien@spaceship.com> writes:
> Is that true if I have a table that consists of lots of 1-char fields?
> For example, if I have a table with 4 billion records, which consist of
> (20) 1-char fields each, then the storage for the data will be something
> like 5 times as large if I use TEXT than if I use "char".

Probably more like 8 times as large, when you allow for alignment
padding --- on most machines, TEXT fields will be aligned on 4-byte
boundaries, so several TEXT fields in a row will take up 8 bytes apiece,
vs one byte apiece for consecutive "char" or bool fields.

            regards, tom lane

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

Предыдущее
От: Matt Mello
Дата:
Сообщение: Re: 1 char in the world
Следующее
От: Andras Kadinger
Дата:
Сообщение: Re: Query plan and Inheritance. Weird behavior