Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcb04ad4

Browse files
committed
Move syncscan.c to src/backend/access/common.
Since the tableam.c code needs to make use of the syncscan.c routinesitself, and since other block-oriented AMs might also want to use it oneday, 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
1 parentc49c74d commitcb04ad4

File tree

9 files changed

+33
-11
lines changed

9 files changed

+33
-11
lines changed

‎src/backend/access/common/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ OBJS = \
2424
reloptions.o\
2525
scankey.o\
2626
session.o\
27+
syncscan.o\
2728
toast_internals.o\
2829
tupconvert.o\
2930
tupdesc.o

‎src/backend/access/heap/syncscan.crenamed to‎src/backend/access/common/syncscan.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*-------------------------------------------------------------------------
22
*
33
* syncscan.c
4-
*heapscan synchronization support
4+
* scan synchronization support
55
*
66
* When multiple backends run a sequential scan on the same table, we try
77
* to keep them synchronized to reduce the overall I/O needed. The goal is
@@ -40,13 +40,13 @@
4040
* Portions Copyright (c) 1994, Regents of the University of California
4141
*
4242
* IDENTIFICATION
43-
* src/backend/access/heap/syncscan.c
43+
* src/backend/access/common/syncscan.c
4444
*
4545
*-------------------------------------------------------------------------
4646
*/
4747
#include"postgres.h"
4848

49-
#include"access/heapam.h"
49+
#include"access/syncscan.h"
5050
#include"miscadmin.h"
5151
#include"storage/lwlock.h"
5252
#include"storage/shmem.h"

‎src/backend/access/heap/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ OBJS = \
2020
hio.o\
2121
pruneheap.o\
2222
rewriteheap.o\
23-
syncscan.o\
2423
vacuumlazy.o\
2524
visibilitymap.o
2625

‎src/backend/access/heap/heapam.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include"access/parallel.h"
4242
#include"access/relscan.h"
4343
#include"access/subtrans.h"
44+
#include"access/syncscan.h"
4445
#include"access/sysattr.h"
4546
#include"access/tableam.h"
4647
#include"access/transam.h"

‎src/backend/access/heap/heapam_handler.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include"access/heaptoast.h"
2525
#include"access/multixact.h"
2626
#include"access/rewriteheap.h"
27+
#include"access/syncscan.h"
2728
#include"access/tableam.h"
2829
#include"access/tsmapi.h"
2930
#include"access/xact.h"

‎src/backend/access/table/tableam.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#include<math.h>
2323

24-
#include"access/heapam.h"/* for ss_* */
24+
#include"access/syncscan.h"
2525
#include"access/tableam.h"
2626
#include"access/xact.h"
2727
#include"optimizer/plancat.h"

‎src/backend/storage/ipc/ipci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include"access/multixact.h"
2121
#include"access/nbtree.h"
2222
#include"access/subtrans.h"
23+
#include"access/syncscan.h"
2324
#include"access/twophase.h"
2425
#include"commands/async.h"
2526
#include"miscadmin.h"

‎src/include/access/heapam.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,6 @@ extern void heap_page_prune_execute(Buffer buffer,
182182
OffsetNumber*nowunused,intnunused);
183183
externvoidheap_get_root_tuples(Pagepage,OffsetNumber*root_offsets);
184184

185-
/* in heap/syncscan.c */
186-
externvoidss_report_location(Relationrel,BlockNumberlocation);
187-
externBlockNumberss_get_location(Relationrel,BlockNumberrelnblocks);
188-
externvoidSyncScanShmemInit(void);
189-
externSizeSyncScanShmemSize(void);
190-
191185
/* in heap/vacuumlazy.c */
192186
structVacuumParams;
193187
externvoidheap_vacuum_rel(Relationonerel,

‎src/include/access/syncscan.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* syncscan.h
4+
* POSTGRES synchronous scan support functions.
5+
*
6+
*
7+
* Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
8+
* Portions Copyright (c) 1994, Regents of the University of California
9+
*
10+
* src/include/access/syncscan.h
11+
*
12+
*-------------------------------------------------------------------------
13+
*/
14+
#ifndefSYNCSCAN_H
15+
#defineSYNCSCAN_H
16+
17+
#include"storage/block.h"
18+
#include"utils/relcache.h"
19+
20+
externvoidss_report_location(Relationrel,BlockNumberlocation);
21+
externBlockNumberss_get_location(Relationrel,BlockNumberrelnblocks);
22+
externvoidSyncScanShmemInit(void);
23+
externSizeSyncScanShmemSize(void);
24+
25+
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp