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

From Qingqing Zhou
Subject Re: optimizing vacuum truncation scans
Date
Msg-id CAJjS0u1S5UrWhR8fkia2C=ybfgf+jEw=0RnZuNCUO=F830F7hQ@mail.gmail.com
Whole thread Raw
In response to optimizing vacuum truncation scans  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-hackers
On Sun, Apr 19, 2015 at 7:09 PM, Jeff Janes <jeff.janes@gmail.com> 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
regularbackward scan.
 
IIRC, this patches introduces optional prefetch for the backward scan
where file system prefetch may not work well. The result is promising!

> Also, what would be the best way to drill a hole through bufmgr.c into md.c so that the prefetch could specify an
entirerange, rather than looping over each individual block?
 
>
Different from mdread(), which requires a buffer in argument.
Extending mdprefetch() looks natural and safe to me. This shall also
layout a foundation for other scan style optimizations.

> What would have to be done to detect people running on SSD and disable the feature, if anything?
>
There are other call sites of prefetch - so this shall be a topic not
just for this optimization.

Regards,
Qingqing



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [pgsql-packagers] Palle Girgensohn's ICU patch
Next
From: Bruce Momjian
Date:
Subject: Re: Turning off HOT/Cleanup sometimes