diff options
| author | Amit Kapila | 2019-01-28 06:01:44 +0000 |
|---|---|---|
| committer | Amit Kapila | 2019-01-28 06:01:44 +0000 |
| commit | a23676503b746b7f1588cd2ab0c60411032d32da (patch) | |
| tree | ac7f172ec94771441558639e0725e6d56d6e7b47 /src/backend/access/heap/vacuumlazy.c | |
| parent | ac88d2962a96a9c7e83d5acfc28fe49a72812086 (diff) | |
Revert "Avoid creation of the free space map for small heap relations."
This reverts commit ac88d2962a96a9c7e83d5acfc28fe49a72812086.
Diffstat (limited to 'src/backend/access/heap/vacuumlazy.c')
| -rw-r--r-- | src/backend/access/heap/vacuumlazy.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/backend/access/heap/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c index 9cfa65ca47f..37aa484ec3a 100644 --- a/src/backend/access/heap/vacuumlazy.c +++ b/src/backend/access/heap/vacuumlazy.c @@ -153,7 +153,7 @@ static BufferAccessStrategy vac_strategy; static void lazy_scan_heap(Relation onerel, int options, LVRelStats *vacrelstats, Relation *Irel, int nindexes, bool aggressive); -static void lazy_vacuum_heap(Relation onerel, LVRelStats *vacrelstats, BlockNumber nblocks); +static void lazy_vacuum_heap(Relation onerel, LVRelStats *vacrelstats); static bool lazy_check_needs_freeze(Buffer buf, bool *hastup); static void lazy_vacuum_index(Relation indrel, IndexBulkDeleteResult **stats, @@ -758,7 +758,7 @@ lazy_scan_heap(Relation onerel, int options, LVRelStats *vacrelstats, pgstat_progress_update_multi_param(2, hvp_index, hvp_val); /* Remove tuples from heap */ - lazy_vacuum_heap(onerel, vacrelstats, nblocks); + lazy_vacuum_heap(onerel, vacrelstats); /* * Forget the now-vacuumed tuples, and press on, but be careful @@ -896,7 +896,7 @@ lazy_scan_heap(Relation onerel, int options, LVRelStats *vacrelstats, MarkBufferDirty(buf); UnlockReleaseBuffer(buf); - RecordPageWithFreeSpace(onerel, blkno, freespace, nblocks); + RecordPageWithFreeSpace(onerel, blkno, freespace); continue; } @@ -935,7 +935,7 @@ lazy_scan_heap(Relation onerel, int options, LVRelStats *vacrelstats, } UnlockReleaseBuffer(buf); - RecordPageWithFreeSpace(onerel, blkno, freespace, nblocks); + RecordPageWithFreeSpace(onerel, blkno, freespace); continue; } @@ -1332,7 +1332,7 @@ lazy_scan_heap(Relation onerel, int options, LVRelStats *vacrelstats, * taken if there are no indexes.) */ if (vacrelstats->num_dead_tuples == prev_dead_count) - RecordPageWithFreeSpace(onerel, blkno, freespace, nblocks); + RecordPageWithFreeSpace(onerel, blkno, freespace); } /* report that everything is scanned and vacuumed */ @@ -1394,7 +1394,7 @@ lazy_scan_heap(Relation onerel, int options, LVRelStats *vacrelstats, /* Remove tuples from heap */ pgstat_progress_update_param(PROGRESS_VACUUM_PHASE, PROGRESS_VACUUM_PHASE_VACUUM_HEAP); - lazy_vacuum_heap(onerel, vacrelstats, nblocks); + lazy_vacuum_heap(onerel, vacrelstats); vacrelstats->num_index_scans++; } @@ -1465,10 +1465,9 @@ lazy_scan_heap(Relation onerel, int options, LVRelStats *vacrelstats, * Note: the reason for doing this as a second pass is we cannot remove * the tuples until we've removed their index entries, and we want to * process index entry removal in batches as large as possible. - * Note: nblocks is passed as an optimization for RecordPageWithFreeSpace(). */ static void -lazy_vacuum_heap(Relation onerel, LVRelStats *vacrelstats, BlockNumber nblocks) +lazy_vacuum_heap(Relation onerel, LVRelStats *vacrelstats) { int tupindex; int npages; @@ -1505,7 +1504,7 @@ lazy_vacuum_heap(Relation onerel, LVRelStats *vacrelstats, BlockNumber nblocks) freespace = PageGetHeapFreeSpace(page); UnlockReleaseBuffer(buf); - RecordPageWithFreeSpace(onerel, tblk, freespace, nblocks); + RecordPageWithFreeSpace(onerel, tblk, freespace); npages++; } |
