Re: [PATCH] Improve treatment of page special and page header alignment during page init. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] Improve treatment of page special and page header alignment during page init.
Date
Msg-id 1593715.1617809895@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH] Improve treatment of page special and page header alignment during page init.  (Pavel Borisov <pashkin.elfe@gmail.com>)
Responses Re: [PATCH] Improve treatment of page special and page header alignment during page init.  (Pavel Borisov <pashkin.elfe@gmail.com>)
List pgsql-hackers
Pavel Borisov <pashkin.elfe@gmail.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



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: WIP: WAL prefetch (another approach)
Next
From: yuzuko
Date:
Subject: Re: Autovacuum on partitioned table (autoanalyze)