1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +03:00

Statistical system views (yet without the config stuff, but

it's hard to keep such massive changes in sync with the tree
so I need to get it in and work from there now).

Jan
This commit is contained in:
Jan Wieck
2001-06-22 19:16:24 +00:00
parent 7d6e28149e
commit 8d80b0d980
34 changed files with 537 additions and 98 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.112 2001/06/09 18:16:57 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.113 2001/06/22 19:16:22 wieck Exp $
*
*-------------------------------------------------------------------------
*/
@ -55,6 +55,8 @@
#include "utils/relcache.h"
#include "catalog/pg_database.h"
#include "pgstat.h"
#define BufferGetLSN(bufHdr) \
(*((XLogRecPtr*)MAKE_PTR((bufHdr)->data)))
@ -147,6 +149,7 @@ ReadBufferInternal(Relation reln, BlockNumber blockNum,
if (isLocalBuf)
{
ReadLocalBufferCount++;
pgstat_count_buffer_read(&reln->pgstat_info, reln);
/* Substitute proper block number if caller asked for P_NEW */
if (blockNum == P_NEW)
{
@ -156,11 +159,15 @@ ReadBufferInternal(Relation reln, BlockNumber blockNum,
}
bufHdr = LocalBufferAlloc(reln, blockNum, &found);
if (found)
{
LocalBufferHitCount++;
pgstat_count_buffer_hit(&reln->pgstat_info, reln);
}
}
else
{
ReadBufferCount++;
pgstat_count_buffer_read(&reln->pgstat_info, reln);
/* Substitute proper block number if caller asked for P_NEW */
if (blockNum == P_NEW)
{
@ -175,7 +182,10 @@ ReadBufferInternal(Relation reln, BlockNumber blockNum,
SpinAcquire(BufMgrLock);
bufHdr = BufferAlloc(reln, blockNum, &found);
if (found)
{
BufferHitCount++;
pgstat_count_buffer_hit(&reln->pgstat_info, reln);
}
}
/* At this point we do NOT hold the bufmgr spinlock. */