diff options
Diffstat (limited to 'src/backend/commands/analyze.c')
-rw-r--r-- | src/backend/commands/analyze.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index 486e86d677c..872edc42988 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.77 2004/09/30 23:21:19 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.78 2004/10/26 16:05:03 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -822,11 +822,12 @@ acquire_sample_rows(Relation onerel, HeapTuple *rows, int targrows, for (targoffset = FirstOffsetNumber; targoffset <= maxoffset; targoffset++) { HeapTupleData targtuple; - Buffer tupbuffer; ItemPointerSet(&targtuple.t_self, targblock, targoffset); - if (heap_fetch(onerel, SnapshotNow, &targtuple, &tupbuffer, - false, NULL)) + /* We use heap_release_fetch to avoid useless bufmgr traffic */ + if (heap_release_fetch(onerel, SnapshotNow, + &targtuple, &targbuffer, + true, NULL)) { /* * The first targrows live rows are simply copied into the @@ -869,9 +870,6 @@ acquire_sample_rows(Relation onerel, HeapTuple *rows, int targrows, rowstoskip -= 1; } - /* must release the extra pin acquired by heap_fetch */ - ReleaseBuffer(tupbuffer); - liverows += 1; } else @@ -886,7 +884,7 @@ acquire_sample_rows(Relation onerel, HeapTuple *rows, int targrows, } } - /* Now release the initial pin on the page */ + /* Now release the pin on the page */ ReleaseBuffer(targbuffer); } |