Обсуждение: Compute the number of tuples in a block

Поиск
Список
Период
Сортировка

Compute the number of tuples in a block

От
Pei He
Дата:
Hi,<br />In ctid, there are the block num, and the tuple offset inside the block.<br /><br />How can I know the maximum
numberof tuples in a block?<br />The block size would be BLCKSZ.<br /><br />I am not quite sure where is the best place
tofind the size of the tuple in a table.<br /><br /><br />Thanks<br />--<br />Pei<br /> 

Re: Compute the number of tuples in a block

От
Robert Haas
Дата:
On Tue, Sep 21, 2010 at 11:42 PM, Pei He <hepeimail@gmail.com> wrote:
> Hi,
> In ctid, there are the block num, and the tuple offset inside the block.
>
> How can I know the maximum number of tuples in a block?
> The block size would be BLCKSZ.

See MaxHeapTuplesPerPage and MaxIndexTuplesPerPage.

> I am not quite sure where is the best place to find the size of the tuple in
> a table.

You might want to look at contrib/pageinspect.  See also PageGetItemId
and ItemIdGetLength.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company