On Sat, 20 Jun 2009, Simon Riggs wrote:

At the time, I also proposed a "filled buffer list" change to bufmgr to
allow bgwriter to preferentially target COPY's filled blocks, which
would also help with this effect.

One of the things I keep meaning to investigate is whether there's any benefit to pushing buffers the background writer cleans onto the free list, to speed up their subsequent allocation to needy backends. Both this and the sequential scan ring buffer implementation might both benefit from an approach where buffers are similarly pushed onto the free list when they're no longer needed by the process that pulled them in. Buffers could move from allocated->used->filled buffer list->free list in the COPY buffer case, and allocated->used->free list when executing a sequential scan.

That would seem to me to be a more robust general approach for solving this class of problem than the whole ring buffer idea, which is a great start but bound to run into situations where the size of the buffer just isn't right anymore a few hardware generations down the road.

--
* Greg Smith gsm...@gregsmith.com http://www.gregsmith.com Baltimore, MD

--
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