Compute the number of tuples in a block

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

Compute the number of tuples in a block

От:
Pei He <hepeimail@gmail.com>
Дата:
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.

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


Thanks
--
Pei

Re: Compute the number of tuples in a block

От:
Robert Haas <robertmhaas@gmail.com>
Дата:
On Tue, Sep 21, 2010 at 11:42 PM, Pei He  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

FAQ