Re: [PATCH] Improve treatment of page special and page header alignment during page init.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Improve treatment of page special and page header alignment during page init.
Date: 2021-04-07 15:38:15
Message-ID: 1593715.1617809895@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com> writes:
>> How can we say that in PageInit the SizeOfPageHeaderData is expected
>> to be max aligned? Am I missing something? There are lots of other
>> places where SizeOfPageHeaderData is used, not
>> MAXALIGN(SizeOfPageHeaderData).

> Its maxalign is ensured by its size of 24bytes (which is maxalign'ed). I
> think if we change this to not-maxalign'ed value bad things can happen. So
> I've added assert checking for this value. I think it is similar situation
> for both page header and page special, I wonder why they've been treated
> differently in PageInit.

No, that's wrong. What follows the page header is the line pointer
array, which is only int-aligned. We need to maxalign the special
space because tuples are stored working backwards from that, and
we want maxalignment for tuples.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message yuzuko 2021-04-07 15:39:16 Re: Autovacuum on partitioned table (autoanalyze)
Previous Message Tomas Vondra 2021-04-07 15:27:43 Re: WIP: WAL prefetch (another approach)