Re: Postgres table size

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Postgres table size
Дата
Msg-id 20071122124837.GA6113@svana.org
обсуждение исходный текст
Ответ на Re: Postgres table size  (SHARMILA JOTHIRAJAH <sharmi_jo@yahoo.com>)
Список pgsql-general
On Wed, Nov 21, 2007 at 09:51:22AM -0800, SHARMILA JOTHIRAJAH wrote:
> Thanks for the detailed explanation Tom. You are rigt...The number of pages for this tables as per pg_class is 189.
>
> I have a few questions
> 1. How do you find  the MAXALIGN of the machine? And what is that used for?

MAXALIGN is the preferred alignment for structure objects, iirc. It's
generally less efficient to access unaligned objects than aligned ones,
though this is architechure specific. You should be able to find it in
your pg_config.h under MAXIMUM_ALIGNOF,.

> 2. How does null columns account for this space. For example, if I
> have the same table (10 cols --5 varchars and 5 numerics) in which 8
> cols are null and 2 cols(1 varchar and 1 num) are not null, how is
> the storage space affected for this case?

The cost is typically one bit per column in the table, unless there are
no NULLs in which case it costs nothing. 10 cols = 2 bytes, which may
or may not be swallowed by alignment.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

Вложения

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

Предыдущее
От: Oleg Bartunov
Дата:
Сообщение: Re: EAV or not to EAV?
Следующее
От: luca.ciciriello@email.it
Дата:
Сообщение: BEGIN strange behaviour