Re: postgresql storage and performance questions

Поиск
Список
Период
Сортировка
От Filip Rembiałkowski
Тема Re: postgresql storage and performance questions
Дата
Msg-id 92869e660711191037r5bdb761ode82046deb2bd249@mail.gmail.com
обсуждение исходный текст
Ответ на postgresql storage and performance questions  ("Josh Harrison" <joshques@gmail.com>)
Ответы Re: postgresql storage and performance questions
Список pgsql-general
2007/11/19, Josh Harrison <joshques@gmail.com>:
> Hi,
> I have a few questions about the storage and performance
>
> 1. How do you estimate the table size in postgresql?
> For example if I have a table 'Dummy' with 1 varchar (40) & 1
> numeric(22,0) fields and 1000 rows, what is the tablesize estimate for
> this (including the row overhead etc)? How many pages will this
> occupy?
>
> 2. Also if the table contains null columns, does postgres allocates
> the same space for these nulls columns? How does it handle 'nulls' in
> terms of storage?

Try these:
http://www.postgresql.org/docs/current/static/datatype-numeric.html
http://www.postgresql.org/docs/current/static/datatype-character.html
http://www.postgresql.org/docs/current/static/storage-page-layout.html

ad.1 )  There is a fixed-size header (occupying 27 bytes on most
machines) for each tuple

so you will have about 27 + 1 +  varchar data + numeric data per row,
plus some overhaed for block headers

ad.2 ) there is a null bitmap for each tuple which has nullable fields
- so every 8 NULLable columns occupy one byte bitmap.


PS. why do you post same thing many times? this is kinda.. spam?

--
Filip Rembiałkowski

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

Предыдущее
От: "Sean Davis"
Дата:
Сообщение: plpython and error catching
Следующее
От: "Josh Harrison"
Дата:
Сообщение: Re: postgresql storage and performance questions