Re: 1 char in the world

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: 1 char in the world
Дата
Msg-id
5513.1043884766@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
1 char in the world Matt Mello <alien@spaceship.com>
Re: 1 char in the world Hannu Krosing <hannu@tm.ee>
Re: 1 char in the world Matt Mello <alien@spaceship.com>
Re: 1 char in the world Tom Lane <tgl@sss.pgh.pa.us>
Re: 1 char in the world Tom Lane <tgl@sss.pgh.pa.us>
Re: 1 char in the world alien <alien@spaceship.com>
Re: 1 char in the world Justin Clift <justin@postgresql.org>
Matt Mello  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
Дата:
FAQ