Skip to content

Commit 285d8e1

Browse files
committed
Move vacuumlazy.c into access/heap.
It's heap table storage specific code that can't realistically be generalized into table AM agnostic code. Author: Andres Freund Discussion: https://postgr.es/m/[email protected]
1 parent 148e632 commit 285d8e1

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

src/backend/access/heap/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ subdir = src/backend/access/heap
1212
top_builddir = ../../../..
1313
include $(top_builddir)/src/Makefile.global
1414

15-
OBJS = heapam.o hio.o pruneheap.o rewriteheap.o syncscan.o tuptoaster.o visibilitymap.o
15+
OBJS = heapam.o hio.o pruneheap.o rewriteheap.o syncscan.o tuptoaster.o \
16+
vacuumlazy.o visibilitymap.o
1617

1718
include $(top_srcdir)/src/backend/common.mk

src/backend/commands/vacuumlazy.c renamed to src/backend/access/heap/vacuumlazy.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*
2929
*
3030
* IDENTIFICATION
31-
* src/backend/commands/vacuumlazy.c
31+
* src/backend/access/heap/vacuumlazy.c
3232
*
3333
*-------------------------------------------------------------------------
3434
*/
@@ -178,7 +178,7 @@ static bool heap_page_is_all_visible(Relation rel, Buffer buf,
178178

179179

180180
/*
181-
* lazy_vacuum_rel() -- perform LAZY VACUUM for one heap relation
181+
* vacuum_heap_rel() -- perform VACUUM for one heap relation
182182
*
183183
* This routine vacuums a single heap, cleans out its indexes, and
184184
* updates its relpages and reltuples statistics.
@@ -187,7 +187,7 @@ static bool heap_page_is_all_visible(Relation rel, Buffer buf,
187187
* and locked the relation.
188188
*/
189189
void
190-
lazy_vacuum_rel(Relation onerel, int options, VacuumParams *params,
190+
heap_vacuum_rel(Relation onerel, int options, VacuumParams *params,
191191
BufferAccessStrategy bstrategy)
192192
{
193193
LVRelStats *vacrelstats;

src/backend/commands/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ OBJS = amcmds.o aggregatecmds.o alter.o analyze.o async.o cluster.o comment.o \
2020
policy.o portalcmds.o prepare.o proclang.o publicationcmds.o \
2121
schemacmds.o seclabel.o sequence.o statscmds.o subscriptioncmds.o \
2222
tablecmds.o tablespace.o trigger.o tsearchcmds.o typecmds.o user.o \
23-
vacuum.o vacuumlazy.o variable.o view.o
23+
vacuum.o variable.o view.o
2424

2525
include $(top_srcdir)/src/backend/common.mk

src/backend/commands/vacuum.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1711,7 +1711,7 @@ vacuum_rel(Oid relid, RangeVar *relation, int options, VacuumParams *params)
17111711
cluster_rel(relid, InvalidOid, cluster_options);
17121712
}
17131713
else
1714-
lazy_vacuum_rel(onerel, options, params, vac_strategy);
1714+
heap_vacuum_rel(onerel, options, params, vac_strategy);
17151715

17161716
/* Roll back any GUC changes executed by index functions */
17171717
AtEOXact_GUC(false, save_nestlevel);

src/include/access/heapam.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,8 @@ extern BlockNumber ss_get_location(Relation rel, BlockNumber relnblocks);
186186
extern void SyncScanShmemInit(void);
187187
extern Size SyncScanShmemSize(void);
188188

189+
/* in heap/vacuumlazy.c */
190+
struct VacuumParams;
191+
extern void heap_vacuum_rel(Relation onerel, int options,
192+
struct VacuumParams *params, BufferAccessStrategy bstrategy);
189193
#endif /* HEAPAM_H */

src/include/commands/vacuum.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,6 @@ extern bool vacuum_is_relation_owner(Oid relid, Form_pg_class reltuple,
196196
extern Relation vacuum_open_relation(Oid relid, RangeVar *relation,
197197
VacuumParams *params, int options, LOCKMODE lmode);
198198

199-
/* in commands/vacuumlazy.c */
200-
extern void lazy_vacuum_rel(Relation onerel, int options,
201-
VacuumParams *params, BufferAccessStrategy bstrategy);
202-
203199
/* in commands/analyze.c */
204200
extern void analyze_rel(Oid relid, RangeVar *relation, int options,
205201
VacuumParams *params, List *va_cols, bool in_outer_xact,

0 commit comments

Comments
 (0)