Re: optimizing vacuum truncation scans

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: optimizing vacuum truncation scans
Date: 2015-07-27 20:40:01
Message-ID: CANP8+jLAFNVnUZRG463qvffWS1o6Uge6Gj5yWk5vVqb4hbPjWQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 22 July 2015 at 17:11, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:

> On Wed, Jul 22, 2015 at 6:59 AM, Robert Haas <robertmhaas(at)gmail(dot)com>
> wrote:
>
>> On Mon, Jun 29, 2015 at 1:54 AM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
>> > Attached is a patch that implements the vm scan for truncation. It
>> > introduces a variable to hold the last blkno which was skipped during
>> the
>> > forward portion. Any blocks after both this blkno and after the last
>> > inspected nonempty page (which the code is already tracking) must have
>> been
>> > observed to be empty by the current vacuum. Any other process
>> rendering the
>> > page nonempty are required to clear the vm bit, and no other process
>> can set
>> > the bit again during the vacuum's lifetime. So if the bit is still
>> set, the
>> > page is still empty without needing to inspect it.
>>
>> Urgh. So if we do this, that forever precludes having HOT pruning set
>> the all-visible bit.
>
>
> I wouldn't say forever, as it would be easy to revert the change if
> something more important came along that conflicted with it.
>

I think what is being said here is that someone is already using this
technique, or if not, then we actively want to encourage them to do so as
an extension or as a submission to core.

In that case, I think the rely-on-VM technique sinks again, sorry Jim,
Jeff. Probably needs code comments added.

That does still leave the prefetch technique, so all is not lost.

Can we see a patch with just prefetch, probably with a simple choice of
stride? Thanks.

--
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 Stephen Frost 2015-07-27 20:58:19 Re: A little RLS oversight?
Previous Message Dean Rasheed 2015-07-27 20:25:46 Re: A little RLS oversight?