Re: a bit more precise MaxOffsetNumber

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tomas Vondra <tv(at)fuzzy(dot)cz>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: a bit more precise MaxOffsetNumber
Date: 2011-05-07 02:02:13
Message-ID: BANLkTimCATSV+dZw-OKcEPttgnRRTOedkA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2011/4/30 Tomas Vondra <tv(at)fuzzy(dot)cz>:
> I've been digging in the sources, and I've noticed the MaxOffsetNumber
> is defined (in storage/off.h) like this
>
>  (BLCKSZ / sizeof(ItemIdData))
>
> I guess it might be made a bit more precise by subtracting the header
> like this
>
>  (BLCKSZ - offsetof(PageHeaderData, pd_linp) / sizeof(ItemIdData))
>
> although the difference is negligible (2048 vs 2042 for 8kB pages).

I guess we could do that, but I'm not sure there's much point. It's
also not entirely clear that this would actually work out to a win,
because of the issues discussed in the "When can/should we prune or
defragment?" section of src/backend/access/heap/README.HOT

We could probably figure this out with some careful testing, but I'm
not sure it's worth the effort.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-05-07 02:03:36 Re: Large Objects versus transactional behavior
Previous Message Robert Haas 2011-05-07 01:55:38 Re: SSI non-serializable UPDATE performance