summaryrefslogtreecommitdiff
path: root/src/backend/storage
diff options
context:
space:
mode:
authorJan Wieck <JanWieck@Yahoo.com>2001-06-22 19:16:24 +0000
committerJan Wieck <JanWieck@Yahoo.com>2001-06-22 19:16:24 +0000
commit8d80b0d980c327edf162e20fdc829559e8aff224 (patch)
treecdd7d11b95a539d7dd771c80e5e1535c75af8b6c /src/backend/storage
parent7d6e28149ea699b28773eefa48acc449b67d6ff4 (diff)
downloadpostgresql-8d80b0d980c327edf162e20fdc829559e8aff224.tar.gz
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
Diffstat (limited to 'src/backend/storage')
-rw-r--r--src/backend/storage/buffer/bufmgr.c12
-rw-r--r--src/backend/storage/large_object/inv_api.c8
2 files changed, 15 insertions, 5 deletions
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index 06abd2e867..8970c907a8 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -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. */
diff --git a/src/backend/storage/large_object/inv_api.c b/src/backend/storage/large_object/inv_api.c
index 6f20449d1f..02b22f618c 100644
--- a/src/backend/storage/large_object/inv_api.c
+++ b/src/backend/storage/large_object/inv_api.c
@@ -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)
{