From: Andres Freund Date: Wed, 3 Oct 2018 15:01:02 +0000 (-0700) Subject: Move vacuumlazy.c into access/heap/ X-Git-Url: http://git.postgresql.org/gitweb/-?a=commitdiff_plain;h=627348cb28788d9a54859e01abe90aafe9f44011;p=users%2Fandresfreund%2Fpostgres.git 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: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- diff --git a/src/backend/access/heap/Makefile b/src/backend/access/heap/Makefile index b83d496bcd..7e7324a916 100644 --- a/src/backend/access/heap/Makefile +++ b/src/backend/access/heap/Makefile @@ -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 diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/access/heap/vacuumlazy.c similarity index 99% rename from src/backend/commands/vacuumlazy.c rename to src/backend/access/heap/vacuumlazy.c index 8134c52253..429f9ad52a 100644 --- a/src/backend/commands/vacuumlazy.c +++ b/src/backend/access/heap/vacuumlazy.c @@ -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; diff --git a/src/backend/commands/Makefile b/src/backend/commands/Makefile index 4a6c99e090..d64628566d 100644 --- a/src/backend/commands/Makefile +++ b/src/backend/commands/Makefile @@ -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 diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index 25b3b0312c..15eec19418 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -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); diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h index 64cfdbd2f0..108e4f1067 100644 --- a/src/include/access/heapam.h +++ b/src/include/access/heapam.h @@ -201,4 +201,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 */ diff --git a/src/include/commands/vacuum.h b/src/include/commands/vacuum.h index 2f4303e40d..8d3e5207e2 100644 --- a/src/include/commands/vacuum.h +++ b/src/include/commands/vacuum.h @@ -191,10 +191,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,