Re: Boolean type storage format
От
Craig Ringer
Тема
Re: Boolean type storage format
Дата
Msg-id
50923934.9040000@ringerc.id.au
Ответ на
Re: Boolean type storage format (Mike Christensen)
Список
Дерево обсуждения
Boolean type storage format "Alexander Gataric" <gataric@usa.net>
Re: Boolean type storage format Raghavendra <raghavendra.rao@enterprisedb.com>
Re: Boolean type storage format Marti Raudsepp <marti@juffo.org>
Re: Boolean type storage format Mike Christensen <mike@kitchenpc.com>
Re: Boolean type storage format Craig Ringer <ringerc@ringerc.id.au>
On 11/01/2012 02:25 AM, Mike Christensen wrote:
> It would also matter what columns were next to it, correct?
It doesn't look like PostgreSQL packs booleans. It still matters what's
next to it because of the alignment requirements of other data types,
but you still have a minimum of one byte per boolean. See:
regress=> SELECT pg_column_size( ROW('t'::boolean) );
pg_column_size
----------------
25
(1 row)
regress=> SELECT pg_column_size( ROW('t'::boolean, 't'::boolean) );
pg_column_size
----------------
26
(1 row)
regress=> SELECT pg_column_size( ROW('t'::boolean, 't'::boolean,
'f'::boolean, 't'::boolean) );
pg_column_size
----------------
28
(1 row)
--
Craig Ringer
В списке pgsql-general по дате отправления