Updated version of Heikki's buffer ring patch, as per my comments here:
http://archives.postgresql.org/pgsql-patches/2007-05/msg00449.php
The COPY IN part of the patch is not there, pending resolution of
whether we think it adds enough value to be worth uglifying
heap_insert's API for. Also, I tentatively reduced the threshold
at which heapscans switch to ring mode to NBuffers/16; that probably
needs more thought. Lastly, I haven't done anything about making
non-btree indexes honor the access strategy during VACUUM scans.
regards, tom lane