Move vacuumlazy.c into access/heap/
authorAndres Freund <andres@anarazel.de>
Wed, 3 Oct 2018 15:01:02 +0000 (08:01 -0700)
committerAndres Freund <andres@anarazel.de>
Tue, 11 Dec 2018 00:48:56 +0000 (16:48 -0800)
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:

src/backend/access/heap/Makefile
src/backend/access/heap/vacuumlazy.c [moved from src/backend/commands/vacuumlazy.c with 99% similarity]
src/backend/commands/Makefile
src/backend/commands/vacuum.c
src/include/access/heapam.h
src/include/commands/vacuum.h

index b83d496bcd73e73ad775c40f8fa9c9342f391243..7e7324a9166f330f2d87c44f27d6890f86ad2cdb 100644 (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
similarity index 99%
rename from src/backend/commands/vacuumlazy.c
rename to src/backend/access/heap/vacuumlazy.c
index 8134c52253e1c5c03374cb763a630661740da860..429f9ad52a22aa39bf539fa4d08b555316c26718 100644 (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;
index 4a6c99e09081a533f099d5f175f0806048b6ae9c..d64628566d361af728b629c5ca4492e53cec0321 100644 (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
index 25b3b0312c7c0e23fd1519b624c5b2d7f3a0df85..15eec19418c8e5358155f3317260ff8e0ac0474b 100644 (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);
index 64cfdbd2f0612077b321e48559b3cfb0d296f02d..108e4f10671d500144cae9ccb470463e81917aaf 100644 (file)
@@ -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 */
index 2f4303e40d83eedd53fe3b1ee12848d427345fe6..8d3e5207e2f3431d15ee4ff8e22a10267b26c8c9 100644 (file)
@@ -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,