Compute the number of tuples in a block

Started by Pei Heover 15 years ago2 messages
#1Pei 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

#2Robert Haas
robertmhaas@gmail.com
In reply to: Pei He (#1)
Re: Compute the number of tuples in a block

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