mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
Cost based vacuum delay feature.
Jan
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.155 2004/02/04 01:24:53 wieck Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.156 2004/02/06 19:36:18 wieck Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -576,6 +576,12 @@ write_buffer(Buffer buffer, bool release)
|
||||
LWLockAcquire(BufMgrLock, LW_EXCLUSIVE);
|
||||
Assert(bufHdr->refcount > 0);
|
||||
|
||||
/*
|
||||
* If the buffer is not dirty yet, do vacuum cost accounting.
|
||||
*/
|
||||
if (!(bufHdr->flags & BM_DIRTY) && VacuumCostActive)
|
||||
VacuumCostBalance += VacuumCostPageDirty;
|
||||
|
||||
bufHdr->flags |= (BM_DIRTY | BM_JUST_DIRTIED);
|
||||
|
||||
if (release)
|
||||
|
Reference in New Issue
Block a user