aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2019-01-15 12:06:19 -0800
committerAndres Freund <andres@anarazel.de>2019-01-15 12:06:19 -0800
commit285d8e12055f27bce5675e93fef365b6c337f2b3 (patch)
treeddfaa994ec647460be3247289c80caa53719a74f
parent148e632c05412aa46b450d31cc598a0a33222792 (diff)
downloadpostgresql-285d8e12055f27bce5675e93fef365b6c337f2b3.tar.gz
postgresql-285d8e12055f27bce5675e93fef365b6c337f2b3.zip
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
-rw-r--r--src/backend/access/heap/Makefile3
-rw-r--r--src/backend/access/heap/vacuumlazy.c (renamed from src/backend/commands/vacuumlazy.c)6
-rw-r--r--src/backend/commands/Makefile2
-rw-r--r--src/backend/commands/vacuum.c2
-rw-r--r--src/include/access/heapam.h4
-rw-r--r--src/include/commands/vacuum.h4
6 files changed, 11 insertions, 10 deletions
diff --git a/src/backend/access/heap/Makefile b/src/backend/access/heap/Makefile
index b83d496bcd7..7e7324a9166 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
index b67267fbab5..2d317a94620 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 4a6c99e0908..d64628566d3 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 ff1e178bc34..c4522cdc080 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 cf2ac151241..4b781503305 100644
--- a/src/include/access/heapam.h
+++ b/src/include/access/heapam.h
@@ -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 */
diff --git a/src/include/commands/vacuum.h b/src/include/commands/vacuum.h
index 0588139b25d..0a051ec06e2 100644
--- a/src/include/commands/vacuum.h
+++ b/src/include/commands/vacuum.h
@@ -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,