Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 48ee6f4

Browse files
committed
This trivial patch removes the usage of some old statistics code that no
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
1 parent 0845b6f commit 48ee6f4

File tree

4 files changed

+5
-100
lines changed

4 files changed

+5
-100
lines changed

src/backend/access/heap/heapam.c

Lines changed: 1 addition & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.149 2002/09/26 22:46:29 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.150 2003/02/13 05:35:07 momjian Exp $
1212
*
1313
*
1414
* INTERFACE ROUTINES
@@ -124,12 +124,6 @@ heapgettup(Relation relation,
124124
int linesleft;
125125
ItemPointer tid;
126126

127-
/*
128-
* increment access statistics
129-
*/
130-
IncrHeapAccessStat(local_heapgettup);
131-
IncrHeapAccessStat(global_heapgettup);
132-
133127
tid = (tuple->t_data == NULL) ? (ItemPointer) NULL : &(tuple->t_self);
134128

135129
/*
@@ -461,12 +455,6 @@ relation_open(Oid relationId, LOCKMODE lockmode)
461455

462456
Assert(lockmode >= NoLock && lockmode < MAX_LOCKMODES);
463457

464-
/*
465-
* increment access statistics
466-
*/
467-
IncrHeapAccessStat(local_open);
468-
IncrHeapAccessStat(global_open);
469-
470458
/* The relcache does all the real work... */
471459
r = RelationIdGetRelation(relationId);
472460

@@ -535,12 +523,6 @@ relation_openr(const char *sysRelationName, LOCKMODE lockmode)
535523

536524
Assert(lockmode >= NoLock && lockmode < MAX_LOCKMODES);
537525

538-
/*
539-
* increment access statistics
540-
*/
541-
IncrHeapAccessStat(local_openr);
542-
IncrHeapAccessStat(global_openr);
543-
544526
/*
545527
* We assume we should not need to worry about the rel's OID changing,
546528
* hence no need for AcceptInvalidationMessages here.
@@ -572,12 +554,6 @@ relation_close(Relation relation, LOCKMODE lockmode)
572554
{
573555
Assert(lockmode >= NoLock && lockmode < MAX_LOCKMODES);
574556

575-
/*
576-
* increment access statistics
577-
*/
578-
IncrHeapAccessStat(local_close);
579-
IncrHeapAccessStat(global_close);
580-
581557
if (lockmode != NoLock)
582558
UnlockRelation(relation, lockmode);
583559

@@ -685,12 +661,6 @@ heap_beginscan(Relation relation, Snapshot snapshot,
685661
{
686662
HeapScanDesc scan;
687663

688-
/*
689-
* increment access statistics
690-
*/
691-
IncrHeapAccessStat(local_beginscan);
692-
IncrHeapAccessStat(global_beginscan);
693-
694664
/*
695665
* sanity checks
696666
*/
@@ -743,12 +713,6 @@ void
743713
heap_rescan(HeapScanDesc scan,
744714
ScanKey key)
745715
{
746-
/*
747-
* increment access statistics
748-
*/
749-
IncrHeapAccessStat(local_rescan);
750-
IncrHeapAccessStat(global_rescan);
751-
752716
/*
753717
* unpin scan buffers
754718
*/
@@ -773,12 +737,6 @@ heap_rescan(HeapScanDesc scan,
773737
void
774738
heap_endscan(HeapScanDesc scan)
775739
{
776-
/*
777-
* increment access statistics
778-
*/
779-
IncrHeapAccessStat(local_endscan);
780-
IncrHeapAccessStat(global_endscan);
781-
782740
/* Note: no locking manipulations needed */
783741

784742
/*
@@ -827,12 +785,6 @@ heap_endscan(HeapScanDesc scan)
827785
HeapTuple
828786
heap_getnext(HeapScanDesc scan, ScanDirection direction)
829787
{
830-
/*
831-
* increment access statistics
832-
*/
833-
IncrHeapAccessStat(local_getnext);
834-
IncrHeapAccessStat(global_getnext);
835-
836788
/* Note: no locking manipulations needed */
837789

838790
/*
@@ -916,12 +868,6 @@ heap_fetch(Relation relation,
916868
OffsetNumber offnum;
917869
bool valid;
918870

919-
/*
920-
* increment access statistics
921-
*/
922-
IncrHeapAccessStat(local_fetch);
923-
IncrHeapAccessStat(global_fetch);
924-
925871
/*
926872
* get the buffer from the relation descriptor. Note that this does a
927873
* buffer pin.
@@ -1110,10 +1056,6 @@ heap_insert(Relation relation, HeapTuple tup, CommandId cid)
11101056
{
11111057
Buffer buffer;
11121058

1113-
/* increment access statistics */
1114-
IncrHeapAccessStat(local_insert);
1115-
IncrHeapAccessStat(global_insert);
1116-
11171059
if (relation->rd_rel->relhasoids)
11181060
{
11191061
#ifdef NOT_USED
@@ -1272,10 +1214,6 @@ heap_delete(Relation relation, ItemPointer tid,
12721214
Buffer buffer;
12731215
int result;
12741216

1275-
/* increment access statistics */
1276-
IncrHeapAccessStat(local_delete);
1277-
IncrHeapAccessStat(global_delete);
1278-
12791217
Assert(ItemPointerIsValid(tid));
12801218

12811219
buffer = ReadBuffer(relation, ItemPointerGetBlockNumber(tid));
@@ -1471,10 +1409,6 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
14711409
pagefree;
14721410
int result;
14731411

1474-
/* increment access statistics */
1475-
IncrHeapAccessStat(local_replace);
1476-
IncrHeapAccessStat(global_replace);
1477-
14781412
Assert(ItemPointerIsValid(otid));
14791413

14801414
buffer = ReadBuffer(relation, ItemPointerGetBlockNumber(otid));
@@ -1796,10 +1730,6 @@ heap_mark4update(Relation relation, HeapTuple tuple, Buffer *buffer,
17961730
PageHeader dp;
17971731
int result;
17981732

1799-
/* increment access statistics */
1800-
IncrHeapAccessStat(local_mark4update);
1801-
IncrHeapAccessStat(global_mark4update);
1802-
18031733
*buffer = ReadBuffer(relation, ItemPointerGetBlockNumber(tid));
18041734

18051735
if (!BufferIsValid(*buffer))
@@ -1901,12 +1831,6 @@ heap_mark4update(Relation relation, HeapTuple tuple, Buffer *buffer,
19011831
void
19021832
heap_markpos(HeapScanDesc scan)
19031833
{
1904-
/*
1905-
* increment access statistics
1906-
*/
1907-
IncrHeapAccessStat(local_markpos);
1908-
IncrHeapAccessStat(global_markpos);
1909-
19101834
/* Note: no locking manipulations needed */
19111835

19121836
if (scan->rs_ctup.t_data != NULL)
@@ -1935,12 +1859,6 @@ heap_markpos(HeapScanDesc scan)
19351859
void
19361860
heap_restrpos(HeapScanDesc scan)
19371861
{
1938-
/*
1939-
* increment access statistics
1940-
*/
1941-
IncrHeapAccessStat(local_restrpos);
1942-
IncrHeapAccessStat(global_restrpos);
1943-
19441862
/* XXX no amrestrpos checking that ammarkpos called */
19451863

19461864
/* Note: no locking manipulations needed */

src/backend/access/heap/hio.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Id: hio.c,v 1.46 2002/08/06 02:36:33 tgl Exp $
11+
* $Id: hio.c,v 1.47 2003/02/13 05:35:11 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -37,12 +37,6 @@ RelationPutHeapTuple(Relation relation,
3737
ItemId itemId;
3838
Item item;
3939

40-
/*
41-
* increment access statistics
42-
*/
43-
IncrHeapAccessStat(local_RelationPutHeapTuple);
44-
IncrHeapAccessStat(global_RelationPutHeapTuple);
45-
4640
/* Add the tuple to the page */
4741
pageHeader = BufferGetPage(buffer);
4842

src/backend/storage/buffer/bufmgr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.133 2002/09/14 19:59:20 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.134 2003/02/13 05:35:11 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -424,7 +424,7 @@ BufferAlloc(Relation reln,
424424
{
425425
/*
426426
* BM_JUST_DIRTIED cleared by BufferReplace and shouldn't
427-
* be setted by anyone. - vadim 01/17/97
427+
* be set by anyone. - vadim 01/17/97
428428
*/
429429
if (buf->flags & BM_JUST_DIRTIED)
430430
{

src/include/access/heapam.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: heapam.h,v 1.79 2002/09/04 20:31:36 momjian Exp $
10+
* $Id: heapam.h,v 1.80 2003/02/13 05:35:11 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -25,13 +25,6 @@
2525
#include "utils/rel.h"
2626
#include "utils/tqual.h"
2727

28-
/* ----------------------------------------------------------------
29-
* leftover cruft from old statistics code
30-
* ----------------------------------------------------------------
31-
*/
32-
33-
#define IncrHeapAccessStat(x) ((void) 0)
34-
3528
/* ----------------
3629
* fastgetattr
3730
*

0 commit comments

Comments
 (0)