Re: Setting pd_lower in GIN metapage

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Setting pd_lower in GIN metapage
Date: 2017-09-26 07:22:57
Message-ID: d1fb52fc-6e2f-9c73-4a47-256512cc5286@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2017/09/26 12:17, Michael Paquier wrote:
> On Mon, Sep 25, 2017 at 3:48 PM, Amit Langote wrote:
>> So, ISTM, comments that the patches add should all say that setting the
>> meta pages' pd_lower to the correct value helps to pass those pages to
>> xlog.c as compressible standard layout pages, regardless of whether they
>> are actually passed that way. Even if the patches do take care of the
>> latter as well.
>>
>> Did I miss something?
>
> Not that I think of.

Thanks.

> Buffer metabuffer;
> + Page metapage;
> SpGistMetaPageData *metadata;
>
> metabuffer = ReadBuffer(index, SPGIST_METAPAGE_BLKNO);
> + metapage = BufferGetPage(metabuffer);
> No need to define metapage here and to call BufferGetPage() as long as
> the lock on the buffer is not taken.

Ah, okay.

Moved those additions inside the if (ConditionalLockBuffer(metabuffer)) block.

> Except that small thing, the patches do their duty.

Thanks, revised patches attached.

Regards,
Amit

Attachment Content-Type Size
0001-Set-pd_lower-correctly-in-the-GIN-metapage.patch text/plain 6.9 KB
0002-Set-pd_lower-correctly-in-the-BRIN-index-metapage.patch text/plain 4.4 KB
0003-Set-pd_lower-correctly-in-the-SP-GiST-index-metapage.patch text/plain 3.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Hernandez 2017-09-26 07:26:57 Re: Built-in plugin for logical decoding output
Previous Message Amit Langote 2017-09-26 07:16:11 Re: Setting pd_lower in GIN metapage