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/20180703070645.wchpu5muyto5n647@alap3.anarazel.de
This commit is contained in:
Andres Freund 2019-01-15 12:06:19 -08:00
parent 148e632c05
commit 285d8e1205
6 changed files with 11 additions and 10 deletions

View File

@ -12,6 +12,7 @@ subdir = src/backend/access/heap
top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global
OBJS = heapam.o hio.o pruneheap.o rewriteheap.o syncscan.o tuptoaster.o visibilitymap.o
OBJS = heapam.o hio.o pruneheap.o rewriteheap.o syncscan.o tuptoaster.o \
vacuumlazy.o visibilitymap.o
include $(top_srcdir)/src/backend/common.mk

View File

@ -28,7 +28,7 @@
*
*
* IDENTIFICATION
* src/backend/commands/vacuumlazy.c
* src/backend/access/heap/vacuumlazy.c
*
*-------------------------------------------------------------------------
*/
@ -178,7 +178,7 @@ static bool heap_page_is_all_visible(Relation rel, Buffer buf,
/*
* lazy_vacuum_rel() -- perform LAZY VACUUM for one heap relation
* vacuum_heap_rel() -- perform VACUUM for one heap relation
*
* This routine vacuums a single heap, cleans out its indexes, and
* updates its relpages and reltuples statistics.
@ -187,7 +187,7 @@ static bool heap_page_is_all_visible(Relation rel, Buffer buf,
* and locked the relation.
*/
void
lazy_vacuum_rel(Relation onerel, int options, VacuumParams *params,
heap_vacuum_rel(Relation onerel, int options, VacuumParams *params,
BufferAccessStrategy bstrategy)
{
LVRelStats *vacrelstats;

View File

@ -20,6 +20,6 @@ OBJS = amcmds.o aggregatecmds.o alter.o analyze.o async.o cluster.o comment.o \
policy.o portalcmds.o prepare.o proclang.o publicationcmds.o \
schemacmds.o seclabel.o sequence.o statscmds.o subscriptioncmds.o \
tablecmds.o tablespace.o trigger.o tsearchcmds.o typecmds.o user.o \
vacuum.o vacuumlazy.o variable.o view.o
vacuum.o variable.o view.o
include $(top_srcdir)/src/backend/common.mk

View File

@ -1711,7 +1711,7 @@ vacuum_rel(Oid relid, RangeVar *relation, int options, VacuumParams *params)
cluster_rel(relid, InvalidOid, cluster_options);
}
else
lazy_vacuum_rel(onerel, options, params, vac_strategy);
heap_vacuum_rel(onerel, options, params, vac_strategy);
/* Roll back any GUC changes executed by index functions */
AtEOXact_GUC(false, save_nestlevel);

View File

@ -186,4 +186,8 @@ extern BlockNumber ss_get_location(Relation rel, BlockNumber relnblocks);
extern void SyncScanShmemInit(void);
extern Size SyncScanShmemSize(void);
/* in heap/vacuumlazy.c */
struct VacuumParams;
extern void heap_vacuum_rel(Relation onerel, int options,
struct VacuumParams *params, BufferAccessStrategy bstrategy);
#endif /* HEAPAM_H */

View File

@ -196,10 +196,6 @@ extern bool vacuum_is_relation_owner(Oid relid, Form_pg_class reltuple,
extern Relation vacuum_open_relation(Oid relid, RangeVar *relation,
VacuumParams *params, int options, LOCKMODE lmode);
/* in commands/vacuumlazy.c */
extern void lazy_vacuum_rel(Relation onerel, int options,
VacuumParams *params, BufferAccessStrategy bstrategy);
/* in commands/analyze.c */
extern void analyze_rel(Oid relid, RangeVar *relation, int options,
VacuumParams *params, List *va_cols, bool in_outer_xact,