Re: Compute the number of tuples in a block - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Compute the number of tuples in a block
Date
Msg-id AANLkTinrafFcE1rZgmQinUhwvixdYOFSJB3F1t_tvDfv@mail.gmail.com
Whole thread Raw
In response to Compute the number of tuples in a block  (Pei He <hepeimail@gmail.com>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Dennis Björklund
Date:
Subject: Documentation, window functions
Next
From: Abhijit Menon-Sen
Date:
Subject: Re: Multi-branch committing in git, revisited