mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-17 19:30:00 +08:00
Move syncscan.c to src/backend/access/common.
Since the tableam.c code needs to make use of the syncscan.c routines itself, and since other block-oriented AMs might also want to use it one day, it didn't make sense for it to live under src/backend/access/heap. Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CA%2BhUKGLCnG%3DNEAByg6bk%2BCT9JZD97Y%3DAxKhh27Su9FeGWOKvDg%40mail.gmail.com
This commit is contained in:
parent
c49c74d192
commit
cb04ad4985
@ -24,6 +24,7 @@ OBJS = \
|
||||
reloptions.o \
|
||||
scankey.o \
|
||||
session.o \
|
||||
syncscan.o \
|
||||
toast_internals.o \
|
||||
tupconvert.o \
|
||||
tupdesc.o
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* syncscan.c
|
||||
* heap scan synchronization support
|
||||
* scan synchronization support
|
||||
*
|
||||
* When multiple backends run a sequential scan on the same table, we try
|
||||
* to keep them synchronized to reduce the overall I/O needed. The goal is
|
||||
@ -40,13 +40,13 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* src/backend/access/heap/syncscan.c
|
||||
* src/backend/access/common/syncscan.c
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#include "postgres.h"
|
||||
|
||||
#include "access/heapam.h"
|
||||
#include "access/syncscan.h"
|
||||
#include "miscadmin.h"
|
||||
#include "storage/lwlock.h"
|
||||
#include "storage/shmem.h"
|
@ -20,7 +20,6 @@ OBJS = \
|
||||
hio.o \
|
||||
pruneheap.o \
|
||||
rewriteheap.o \
|
||||
syncscan.o \
|
||||
vacuumlazy.o \
|
||||
visibilitymap.o
|
||||
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include "access/parallel.h"
|
||||
#include "access/relscan.h"
|
||||
#include "access/subtrans.h"
|
||||
#include "access/syncscan.h"
|
||||
#include "access/sysattr.h"
|
||||
#include "access/tableam.h"
|
||||
#include "access/transam.h"
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "access/heaptoast.h"
|
||||
#include "access/multixact.h"
|
||||
#include "access/rewriteheap.h"
|
||||
#include "access/syncscan.h"
|
||||
#include "access/tableam.h"
|
||||
#include "access/tsmapi.h"
|
||||
#include "access/xact.h"
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "access/heapam.h" /* for ss_* */
|
||||
#include "access/syncscan.h"
|
||||
#include "access/tableam.h"
|
||||
#include "access/xact.h"
|
||||
#include "optimizer/plancat.h"
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "access/multixact.h"
|
||||
#include "access/nbtree.h"
|
||||
#include "access/subtrans.h"
|
||||
#include "access/syncscan.h"
|
||||
#include "access/twophase.h"
|
||||
#include "commands/async.h"
|
||||
#include "miscadmin.h"
|
||||
|
@ -182,12 +182,6 @@ extern void heap_page_prune_execute(Buffer buffer,
|
||||
OffsetNumber *nowunused, int nunused);
|
||||
extern void heap_get_root_tuples(Page page, OffsetNumber *root_offsets);
|
||||
|
||||
/* in heap/syncscan.c */
|
||||
extern void ss_report_location(Relation rel, BlockNumber location);
|
||||
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,
|
||||
|
25
src/include/access/syncscan.h
Normal file
25
src/include/access/syncscan.h
Normal file
@ -0,0 +1,25 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* syncscan.h
|
||||
* POSTGRES synchronous scan support functions.
|
||||
*
|
||||
*
|
||||
* Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* src/include/access/syncscan.h
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef SYNCSCAN_H
|
||||
#define SYNCSCAN_H
|
||||
|
||||
#include "storage/block.h"
|
||||
#include "utils/relcache.h"
|
||||
|
||||
extern void ss_report_location(Relation rel, BlockNumber location);
|
||||
extern BlockNumber ss_get_location(Relation rel, BlockNumber relnblocks);
|
||||
extern void SyncScanShmemInit(void);
|
||||
extern Size SyncScanShmemSize(void);
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user