Re: COPY FREEZE and PD_ALL_VISIBLE

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: COPY FREEZE and PD_ALL_VISIBLE
Date: 2015-11-03 14:37:21
Message-ID: CANP8+jJ2aS1=DGHC8h_YKwbysiEyooAtS73bDMA27+T-UrWBgg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3 November 2015 at 15:23, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:

> On Fri, Oct 23, 2015 at 6:29 AM, Simon Riggs <simon(at)2ndquadrant(dot)com>
> wrote:
>
>> On 21 October 2015 at 13:31, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
>>
>> Index-only scans will visit the heap for each tuple until the first
>>> VACUUM is done.
>>>
>>> The first vacuum will read the entire table, but not need to write it
>>> anymore. And will create the _vm file.
>>>
>>> I think we really want to create _vm file as well as set PD_ALL_VISIBLE,
>>> but I don't know the best way to do that. Set a flag somewhere and then
>>> create it in bulk at the end of the transaction? Set it bit by bit as the
>>> pages are extended and initialized?
>>>
>>
>> Easy enough to do it at the end of the COPY FREEZE in one step.
>>
>
> Here, we might want to consider that setting bit in visibility map
> will generate WAL log whereas Copy Freeze otherwise skip WAL
> when wal_level is less than archive. This can lead to extra disk
> writes which can slow down Copy Freeze, but OTOH that might
> be acceptable.
>

I'm building the map as I go, in the latest version of this patch I'm
working on.

--
Simon Riggs http://www.2ndQuadrant.com/
<http://www.2ndquadrant.com/>
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2015-11-03 14:44:20 Re: Request: pg_cancel_backend variant that handles 'idle in transaction' sessions
Previous Message Amit Kapila 2015-11-03 14:28:21 Re: COPY FREEZE and PD_ALL_VISIBLE