mirror of
https://github.com/postgres/postgres.git
synced 2025-12-06 00:02:13 +03:00
Just-in-time background writing strategy. This code avoids re-scanning
buffers that cannot possibly need to be cleaned, and estimates how many buffers it should try to clean based on moving averages of recent allocation requests and density of reusable buffers. The patch also adds a couple more columns to pg_stat_bgwriter to help measure the effectiveness of the bgwriter. Greg Smith, building on his own work and ideas from several other people, in particular a much older patch from Itagaki Takahiro.
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
*
|
||||
* Copyright (c) 2001-2007, PostgreSQL Global Development Group
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.165 2007/09/24 03:12:23 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.166 2007/09/25 20:03:37 tgl Exp $
|
||||
* ----------
|
||||
*/
|
||||
#include "postgres.h"
|
||||
@@ -3165,4 +3165,6 @@ pgstat_recv_bgwriter(PgStat_MsgBgWriter *msg, int len)
|
||||
globalStats.buf_written_checkpoints += msg->m_buf_written_checkpoints;
|
||||
globalStats.buf_written_clean += msg->m_buf_written_clean;
|
||||
globalStats.maxwritten_clean += msg->m_maxwritten_clean;
|
||||
globalStats.buf_written_backend += msg->m_buf_written_backend;
|
||||
globalStats.buf_alloc += msg->m_buf_alloc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user