Re: optimizing vacuum truncation scans - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: optimizing vacuum truncation scans
Date
Msg-id 553490C1.5010805@BlueTreble.com
Whole thread Raw
In response to optimizing vacuum truncation scans  (Jeff Janes <jeff.janes@gmail.com>)
Responses Re: optimizing vacuum truncation scans
List pgsql-hackers
On 4/19/15 9:09 PM, Jeff Janes wrote:
> I did literally the simplest thing I could think of as a proof of
> concept patch, to see if it would actually fix things.  I just jumped
> back a certain number of blocks occasionally and prefetched them
> forward, then resumed the regular backward scan.  The patch and driving
> script are attached.

Shouldn't completely empty pages be set as all-visible in the VM? If so, 
can't we just find the largest not-all-visible page and move forward 
from there, instead of moving backwards like we currently do?

For that matter, why do we scan backwards anyway? The comments don't 
explain it, and we have nonempty_pages as a starting point, so why don't 
we just scan forward? I suspect that eons ago we didn't have that and 
just blindly reverse-scanned until we finally hit a non-empty buffer...
-- 
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com



pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Re: PATCH: adaptive ndistinct estimator v4
Next
From: Heikki Linnakangas
Date:
Subject: Re: alternative compression algorithms?