Skip to content

Commit f8a6bf8

Browse files
committed
Add new callback 'scan_flags' for table access method
The table access method supports different features due to the different implementation, this callback is used to indicate what the AM can do, what features the AM can support.
1 parent 6825174 commit f8a6bf8

7 files changed

Lines changed: 23 additions & 0 deletions

File tree

src/backend/access/aocs/aocsam_handler.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,12 @@ aoco_getnextslot(TableScanDesc scan, ScanDirection direction, TupleTableSlot *sl
757757
return false;
758758
}
759759

760+
static int
761+
aoco_scan_flags(Relation rel)
762+
{
763+
return 0;
764+
}
765+
760766
static Size
761767
aoco_parallelscan_estimate(Relation rel)
762768
{
@@ -2402,6 +2408,7 @@ static TableAmRoutine ao_column_methods = {
24022408
.scan_end = aoco_endscan,
24032409
.scan_rescan = aoco_rescan,
24042410
.scan_getnextslot = aoco_getnextslot,
2411+
.scan_flags = aoco_scan_flags,
24052412

24062413
.parallelscan_estimate = aoco_parallelscan_estimate,
24072414
.parallelscan_initialize = aoco_parallelscan_initialize,

src/backend/access/appendonly/appendonlyam.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,6 +1799,12 @@ appendonly_getnextslot(TableScanDesc scan, ScanDirection direction, TupleTableSl
17991799
return false;
18001800
}
18011801

1802+
int
1803+
appendonly_scan_flags(Relation relation)
1804+
{
1805+
return 0;
1806+
}
1807+
18021808
static void
18031809
closeFetchSegmentFile(AppendOnlyFetchDesc aoFetchDesc)
18041810
{

src/backend/access/appendonly/appendonlyam_handler.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2345,6 +2345,7 @@ static const TableAmRoutine ao_row_methods = {
23452345
.scan_end = appendonly_endscan,
23462346
.scan_rescan = appendonly_rescan,
23472347
.scan_getnextslot = appendonly_getnextslot,
2348+
.scan_flags = appendonly_scan_flags,
23482349

23492350
.parallelscan_estimate = appendonly_parallelscan_estimate,
23502351
.parallelscan_initialize = appendonly_parallelscan_initialize,

src/backend/access/heap/heapam.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,6 +1621,12 @@ heap_getnextslot_tidrange(TableScanDesc sscan, ScanDirection direction,
16211621
return true;
16221622
}
16231623

1624+
int
1625+
heap_scan_flags(Relation relation)
1626+
{
1627+
return 0;
1628+
}
1629+
16241630
/*
16251631
* heap_fetch - retrieve tuple with given tid
16261632
*

src/backend/access/heap/heapam_handler.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2597,6 +2597,7 @@ static const TableAmRoutine heapam_methods = {
25972597

25982598
.scan_set_tidrange = heap_set_tidrange,
25992599
.scan_getnextslot_tidrange = heap_getnextslot_tidrange,
2600+
.scan_flags = heap_scan_flags,
26002601

26012602
.parallelscan_estimate = table_block_parallelscan_estimate,
26022603
.parallelscan_initialize = table_block_parallelscan_initialize,

src/include/access/heapam.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ extern void heap_set_tidrange(TableScanDesc sscan, ItemPointer mintid,
135135
extern bool heap_getnextslot_tidrange(TableScanDesc sscan,
136136
ScanDirection direction,
137137
TupleTableSlot *slot);
138+
extern int heap_scan_flags(Relation relation);
138139
extern bool heap_fetch(Relation relation, Snapshot snapshot,
139140
HeapTuple tuple, Buffer *userbuf);
140141
extern bool heap_fetch_extended(Relation relation, Snapshot snapshot,

src/include/cdb/cdbappendonlyam.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ extern void appendonly_endscan(TableScanDesc scan);
445445
extern bool appendonly_getnextslot(TableScanDesc scan,
446446
ScanDirection direction,
447447
TupleTableSlot *slot);
448+
extern int appendonly_scan_flags(Relation relation);
448449
extern AppendOnlyFetchDesc appendonly_fetch_init(
449450
Relation relation,
450451
Snapshot snapshot,

0 commit comments

Comments
 (0)