Re: AdvanceXLInsertBuffer vs. WAL segment compressibility

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Chapman Flack <chap(at)anastigmatix(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: AdvanceXLInsertBuffer vs. WAL segment compressibility
Date: 2017-07-06 13:48:26
Message-ID: d190140f-b6e8-5e2f-c663-c8f9617da18e@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 07/03/2017 06:30 PM, Chapman Flack wrote:
> On 07/03/2017 09:39 AM, Heikki Linnakangas wrote:
>
>> Hmm. That's not the problem, though. Imagine that instead of the loop
>> above, you do just:
>>
>> WALInsertLockUpdateInsertingAt(CurrPos);
>> AdvanceXLInsertBuffer(EndPos, false);
>>
>> AdvanceXLInsertBuffer() will call XLogWrite(), to flush out any pages
>> before EndPos, to make room in the wal_buffers for the new pages. Before
>> doing that, it will call WaitXLogInsertionsToFinish()
>
> Although it's moot in the straightforward approach of re-zeroing in
> the loop, it would still help my understanding of the system to know
> if there is some subtlety that would have broken what I proposed
> earlier, which was an extra flag to AdvanceXLInsertBuffer() that
> would tell it not only to skip initializing headers, but also to
> skip the WaitXLogInsertionsToFinish() check ... because I have
> the entire region reserved and I hold all the writer slots
> at that moment, it seems safe to assure AdvanceXLInsertBuffer()
> that there are no outstanding writes to wait for.

Yeah, I suppose that would work, too.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Finnerty 2017-07-06 14:29:07 Re: Challenges preventing us moving to 64 bit transaction id (XID)?
Previous Message AP 2017-07-06 13:10:34 Re: pgsql 10: hash indexes testing