Alvaro Herrera <alvhe...@commandprompt.com> writes: > Excerpts from Jeff Janes's message of vie dic 10 12:24:34 -0300 2010: >> As far as I can tell, bgwriter never adds things to the freelist. >> That is only done at start up, and when a relation or a database is >> dropped. The clock sweep does the vast majority of the work.
> AFAIU bgwriter runs the clock sweep most of the time (BgBufferSync). I think bgwriter just tries to write out dirty buffers so they'll be clean when the clock sweep reaches them. It doesn't try to move them to the freelist. There might be some advantage in having it move buffers to a freelist that's just protected by a simple spinlock (or at least, a lock different from the one that protects the clock sweep). The idea would be that most of the time, backends just need to lock the freelist for long enough to take a buffer off it, and don't run clock sweep at all. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers