mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +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:
@@ -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. */
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.87 2001/03/25 23:23:59 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.88 2001/06/22 19:16:23 wieck Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -227,7 +227,7 @@ inv_getsize(LargeObjectDesc *obj_desc)
|
||||
while ((indexRes = index_getnext(sd, BackwardScanDirection)))
|
||||
{
|
||||
tuple.t_self = indexRes->heap_iptr;
|
||||
heap_fetch(obj_desc->heap_r, SnapshotNow, &tuple, &buffer);
|
||||
heap_fetch(obj_desc->heap_r, SnapshotNow, &tuple, &buffer, sd);
|
||||
pfree(indexRes);
|
||||
if (tuple.t_data == NULL)
|
||||
continue;
|
||||
@@ -339,7 +339,7 @@ inv_read(LargeObjectDesc *obj_desc, char *buf, int nbytes)
|
||||
while ((indexRes = index_getnext(sd, ForwardScanDirection)))
|
||||
{
|
||||
tuple.t_self = indexRes->heap_iptr;
|
||||
heap_fetch(obj_desc->heap_r, SnapshotNow, &tuple, &buffer);
|
||||
heap_fetch(obj_desc->heap_r, SnapshotNow, &tuple, &buffer, sd);
|
||||
pfree(indexRes);
|
||||
|
||||
if (tuple.t_data == NULL)
|
||||
@@ -473,7 +473,7 @@ inv_write(LargeObjectDesc *obj_desc, char *buf, int nbytes)
|
||||
while ((indexRes = index_getnext(sd, ForwardScanDirection)))
|
||||
{
|
||||
oldtuple.t_self = indexRes->heap_iptr;
|
||||
heap_fetch(obj_desc->heap_r, SnapshotNow, &oldtuple, &buffer);
|
||||
heap_fetch(obj_desc->heap_r, SnapshotNow, &oldtuple, &buffer, sd);
|
||||
pfree(indexRes);
|
||||
if (oldtuple.t_data != NULL)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user