OSDN Git Service

This trivial patch removes the usage of some old statistics code that no
authorBruce Momjian <bruce@momjian.us>
Thu, 13 Feb 2003 05:35:11 +0000 (05:35 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 13 Feb 2003 05:35:11 +0000 (05:35 +0000)
longer works -- IncrHeapAccessStat() didn't actually *do* anything
anymore, so no reason to keep it around AFAICS. I also fixed a
grammatical error in a comment.

Neil Conway

src/backend/access/heap/heapam.c
src/backend/access/heap/hio.c
src/backend/storage/buffer/bufmgr.c
src/include/access/heapam.h

index e5e509f..cb0c28c 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.149 2002/09/26 22:46:29 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.150 2003/02/13 05:35:07 momjian Exp $
  *
  *
  * INTERFACE ROUTINES
@@ -124,12 +124,6 @@ heapgettup(Relation relation,
        int                     linesleft;
        ItemPointer tid;
 
-       /*
-        * increment access statistics
-        */
-       IncrHeapAccessStat(local_heapgettup);
-       IncrHeapAccessStat(global_heapgettup);
-
        tid = (tuple->t_data == NULL) ? (ItemPointer) NULL : &(tuple->t_self);
 
        /*
@@ -461,12 +455,6 @@ relation_open(Oid relationId, LOCKMODE lockmode)
 
        Assert(lockmode >= NoLock && lockmode < MAX_LOCKMODES);
 
-       /*
-        * increment access statistics
-        */
-       IncrHeapAccessStat(local_open);
-       IncrHeapAccessStat(global_open);
-
        /* The relcache does all the real work... */
        r = RelationIdGetRelation(relationId);
 
@@ -536,12 +524,6 @@ relation_openr(const char *sysRelationName, LOCKMODE lockmode)
        Assert(lockmode >= NoLock && lockmode < MAX_LOCKMODES);
 
        /*
-        * increment access statistics
-        */
-       IncrHeapAccessStat(local_openr);
-       IncrHeapAccessStat(global_openr);
-
-       /*
         * We assume we should not need to worry about the rel's OID changing,
         * hence no need for AcceptInvalidationMessages here.
         */
@@ -572,12 +554,6 @@ relation_close(Relation relation, LOCKMODE lockmode)
 {
        Assert(lockmode >= NoLock && lockmode < MAX_LOCKMODES);
 
-       /*
-        * increment access statistics
-        */
-       IncrHeapAccessStat(local_close);
-       IncrHeapAccessStat(global_close);
-
        if (lockmode != NoLock)
                UnlockRelation(relation, lockmode);
 
@@ -686,12 +662,6 @@ heap_beginscan(Relation relation, Snapshot snapshot,
        HeapScanDesc scan;
 
        /*
-        * increment access statistics
-        */
-       IncrHeapAccessStat(local_beginscan);
-       IncrHeapAccessStat(global_beginscan);
-
-       /*
         * sanity checks
         */
        if (!RelationIsValid(relation))
@@ -744,12 +714,6 @@ heap_rescan(HeapScanDesc scan,
                        ScanKey key)
 {
        /*
-        * increment access statistics
-        */
-       IncrHeapAccessStat(local_rescan);
-       IncrHeapAccessStat(global_rescan);
-
-       /*
         * unpin scan buffers
         */
        if (BufferIsValid(scan->rs_cbuf))
@@ -773,12 +737,6 @@ heap_rescan(HeapScanDesc scan,
 void
 heap_endscan(HeapScanDesc scan)
 {
-       /*
-        * increment access statistics
-        */
-       IncrHeapAccessStat(local_endscan);
-       IncrHeapAccessStat(global_endscan);
-
        /* Note: no locking manipulations needed */
 
        /*
@@ -827,12 +785,6 @@ heap_endscan(HeapScanDesc scan)
 HeapTuple
 heap_getnext(HeapScanDesc scan, ScanDirection direction)
 {
-       /*
-        * increment access statistics
-        */
-       IncrHeapAccessStat(local_getnext);
-       IncrHeapAccessStat(global_getnext);
-
        /* Note: no locking manipulations needed */
 
        /*
@@ -917,12 +869,6 @@ heap_fetch(Relation relation,
        bool            valid;
 
        /*
-        * increment access statistics
-        */
-       IncrHeapAccessStat(local_fetch);
-       IncrHeapAccessStat(global_fetch);
-
-       /*
         * get the buffer from the relation descriptor. Note that this does a
         * buffer pin.
         */
@@ -1110,10 +1056,6 @@ heap_insert(Relation relation, HeapTuple tup, CommandId cid)
 {
        Buffer          buffer;
 
-       /* increment access statistics */
-       IncrHeapAccessStat(local_insert);
-       IncrHeapAccessStat(global_insert);
-
        if (relation->rd_rel->relhasoids)
        {
 #ifdef NOT_USED
@@ -1272,10 +1214,6 @@ heap_delete(Relation relation, ItemPointer tid,
        Buffer          buffer;
        int                     result;
 
-       /* increment access statistics */
-       IncrHeapAccessStat(local_delete);
-       IncrHeapAccessStat(global_delete);
-
        Assert(ItemPointerIsValid(tid));
 
        buffer = ReadBuffer(relation, ItemPointerGetBlockNumber(tid));
@@ -1471,10 +1409,6 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
                                pagefree;
        int                     result;
 
-       /* increment access statistics */
-       IncrHeapAccessStat(local_replace);
-       IncrHeapAccessStat(global_replace);
-
        Assert(ItemPointerIsValid(otid));
 
        buffer = ReadBuffer(relation, ItemPointerGetBlockNumber(otid));
@@ -1796,10 +1730,6 @@ heap_mark4update(Relation relation, HeapTuple tuple, Buffer *buffer,
        PageHeader      dp;
        int                     result;
 
-       /* increment access statistics */
-       IncrHeapAccessStat(local_mark4update);
-       IncrHeapAccessStat(global_mark4update);
-
        *buffer = ReadBuffer(relation, ItemPointerGetBlockNumber(tid));
 
        if (!BufferIsValid(*buffer))
@@ -1901,12 +1831,6 @@ l3:
 void
 heap_markpos(HeapScanDesc scan)
 {
-       /*
-        * increment access statistics
-        */
-       IncrHeapAccessStat(local_markpos);
-       IncrHeapAccessStat(global_markpos);
-
        /* Note: no locking manipulations needed */
 
        if (scan->rs_ctup.t_data != NULL)
@@ -1935,12 +1859,6 @@ heap_markpos(HeapScanDesc scan)
 void
 heap_restrpos(HeapScanDesc scan)
 {
-       /*
-        * increment access statistics
-        */
-       IncrHeapAccessStat(local_restrpos);
-       IncrHeapAccessStat(global_restrpos);
-
        /* XXX no amrestrpos checking that ammarkpos called */
 
        /* Note: no locking manipulations needed */
index 67eb4ad..53cf41c 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Id: hio.c,v 1.46 2002/08/06 02:36:33 tgl Exp $
+ *       $Id: hio.c,v 1.47 2003/02/13 05:35:11 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -37,12 +37,6 @@ RelationPutHeapTuple(Relation relation,
        ItemId          itemId;
        Item            item;
 
-       /*
-        * increment access statistics
-        */
-       IncrHeapAccessStat(local_RelationPutHeapTuple);
-       IncrHeapAccessStat(global_RelationPutHeapTuple);
-
        /* Add the tuple to the page */
        pageHeader = BufferGetPage(buffer);
 
index 6d1e52d..a1abaf2 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.133 2002/09/14 19:59:20 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.134 2003/02/13 05:35:11 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -424,7 +424,7 @@ BufferAlloc(Relation reln,
                        {
                                /*
                                 * BM_JUST_DIRTIED cleared by BufferReplace and shouldn't
-                                * be setted by anyone.         - vadim 01/17/97
+                                * be set by anyone.            - vadim 01/17/97
                                 */
                                if (buf->flags & BM_JUST_DIRTIED)
                                {
index 61c9526..bae635c 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: heapam.h,v 1.79 2002/09/04 20:31:36 momjian Exp $
+ * $Id: heapam.h,v 1.80 2003/02/13 05:35:11 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 #include "utils/rel.h"
 #include "utils/tqual.h"
 
-/* ----------------------------------------------------------------
- *                             leftover cruft from old statistics code
- * ----------------------------------------------------------------
- */
-
-#define IncrHeapAccessStat(x)  ((void) 0)
-
 /* ----------------
  *             fastgetattr
  *