Re: Compute the number of tuples in a block

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Pei He <hepeimail(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Compute the number of tuples in a block
Date: 2010-09-22 10:35:36
Message-ID: AANLkTinrafFcE1rZgmQinUhwvixdYOFSJB3F1t_tvDfv@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 21, 2010 at 11:42 PM, Pei He <hepeimail(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Abhijit Menon-Sen 2010-09-22 10:44:07 Re: Multi-branch committing in git, revisited
Previous Message Robert Haas 2010-09-22 10:31:13 Re: Get the offset of a tuple inside a table