On Sun, Apr 19, 2015 at 7:09 PM, Jeff Janes <jeff.ja...@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 
> regular backward 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 entire range, 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


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to