Re: Physical column size

Поиск
Список
Период
Сортировка
От Mario Weilguni
Тема Re: Physical column size
Дата
Msg-id 200601261222.03526.mweilguni@sime.com
обсуждение исходный текст
Ответ на Physical column size  (Paul Mackay <mackaypaul@gmail.com>)
Список pgsql-performance
Am Donnerstag, 26. Januar 2006 11:06 schrieb Paul Mackay:
> Hi,
>
> I've created a table like this :
> CREATE TABLE tmp_A (
> c "char",
> i int4
> );
>
> And another one
> CREATE TABLE tmp_B (
> i int4,
> ii int4
> );
>
> I then inerted a bit more than 19 million rows in each table (exactly the
> same number of rows in each).
>
> The end result is that the physical size on disk used by table tmp_A is
> exactly the same as table tmp_B (as revealed by the pg_relation_size
> function) ! Given that a "char" field is supposed to be 1 byte in size and
> a int4 4 bytes, shouldn't the tmp_A use a smaller disk space ? Or is it
> that any value, whatever the type, requires at least 4 bytes to be stored ?

I think this is caused by alignment.


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

Предыдущее
От: Paul Mackay
Дата:
Сообщение: Physical column size
Следующее
От: "Jignesh K. Shah"
Дата:
Сообщение: Re: PostgreSQL Solaris packages now in beta