PostgreSQL Source Code git master
tableam.h File Reference
#include "access/relscan.h"
#include "access/sdir.h"
#include "access/xact.h"
#include "commands/vacuum.h"
#include "executor/tuptable.h"
#include "storage/read_stream.h"
#include "utils/rel.h"
#include "utils/snapshot.h"
Include dependency graph for tableam.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  TM_FailureData
 
struct  TM_IndexDelete
 
struct  TM_IndexStatus
 
struct  TM_IndexDeleteOp
 
struct  TableAmRoutine
 

Macros

#define DEFAULT_TABLE_ACCESS_METHOD   "heap"
 
#define TABLE_INSERT_SKIP_FSM   0x0002
 
#define TABLE_INSERT_FROZEN   0x0004
 
#define TABLE_INSERT_NO_LOGICAL   0x0008
 
#define TUPLE_LOCK_FLAG_LOCK_UPDATE_IN_PROGRESS   (1 << 0)
 
#define TUPLE_LOCK_FLAG_FIND_LAST_VERSION   (1 << 1)
 

Typedefs

typedef struct BulkInsertStateData BulkInsertStateData
 
typedef struct IndexInfo IndexInfo
 
typedef struct SampleScanState SampleScanState
 
typedef struct ValidateIndexState ValidateIndexState
 
typedef enum ScanOptions ScanOptions
 
typedef enum TM_Result TM_Result
 
typedef enum TU_UpdateIndexes TU_UpdateIndexes
 
typedef struct TM_FailureData TM_FailureData
 
typedef struct TM_IndexDelete TM_IndexDelete
 
typedef struct TM_IndexStatus TM_IndexStatus
 
typedef struct TM_IndexDeleteOp TM_IndexDeleteOp
 
typedef void(* IndexBuildCallback) (Relation index, ItemPointer tid, Datum *values, bool *isnull, bool tupleIsAlive, void *state)
 
typedef struct TableAmRoutine TableAmRoutine
 

Enumerations

enum  ScanOptions {
  SO_TYPE_SEQSCAN = 1 << 0 , SO_TYPE_BITMAPSCAN = 1 << 1 , SO_TYPE_SAMPLESCAN = 1 << 2 , SO_TYPE_TIDSCAN = 1 << 3 ,
  SO_TYPE_TIDRANGESCAN = 1 << 4 , SO_TYPE_ANALYZE = 1 << 5 , SO_ALLOW_STRAT = 1 << 6 , SO_ALLOW_SYNC = 1 << 7 ,
  SO_ALLOW_PAGEMODE = 1 << 8 , SO_TEMP_SNAPSHOT = 1 << 9
}
 
enum  TM_Result {
  TM_Ok , TM_Invisible , TM_SelfModified , TM_Updated ,
  TM_Deleted , TM_BeingModified , TM_WouldBlock
}
 
enum  TU_UpdateIndexes { TU_None , TU_All , TU_Summarizing }
 

Functions

const TupleTableSlotOpstable_slot_callbacks (Relation relation)
 
TupleTableSlottable_slot_create (Relation relation, List **reglist)
 
static TableScanDesc table_beginscan (Relation rel, Snapshot snapshot, int nkeys, ScanKeyData *key)
 
TableScanDesc table_beginscan_catalog (Relation relation, int nkeys, ScanKeyData *key)
 
static TableScanDesc table_beginscan_strat (Relation rel, Snapshot snapshot, int nkeys, ScanKeyData *key, bool allow_strat, bool allow_sync)
 
static TableScanDesc table_beginscan_bm (Relation rel, Snapshot snapshot, int nkeys, ScanKeyData *key)
 
static TableScanDesc table_beginscan_sampling (Relation rel, Snapshot snapshot, int nkeys, ScanKeyData *key, bool allow_strat, bool allow_sync, bool allow_pagemode)
 
static TableScanDesc table_beginscan_tid (Relation rel, Snapshot snapshot)
 
static TableScanDesc table_beginscan_analyze (Relation rel)
 
static void table_endscan (TableScanDesc scan)
 
static void table_rescan (TableScanDesc scan, ScanKeyData *key)
 
static void table_rescan_set_params (TableScanDesc scan, ScanKeyData *key, bool allow_strat, bool allow_sync, bool allow_pagemode)
 
static bool table_scan_getnextslot (TableScanDesc sscan, ScanDirection direction, TupleTableSlot *slot)
 
static TableScanDesc table_beginscan_tidrange (Relation rel, Snapshot snapshot, ItemPointer mintid, ItemPointer maxtid)
 
static void table_rescan_tidrange (TableScanDesc sscan, ItemPointer mintid, ItemPointer maxtid)
 
static bool table_scan_getnextslot_tidrange (TableScanDesc sscan, ScanDirection direction, TupleTableSlot *slot)
 
Size table_parallelscan_estimate (Relation rel, Snapshot snapshot)
 
void table_parallelscan_initialize (Relation rel, ParallelTableScanDesc pscan, Snapshot snapshot)
 
TableScanDesc table_beginscan_parallel (Relation relation, ParallelTableScanDesc pscan)
 
TableScanDesc table_beginscan_parallel_tidrange (Relation relation, ParallelTableScanDesc pscan)
 
static void table_parallelscan_reinitialize (Relation rel, ParallelTableScanDesc pscan)
 
static IndexFetchTableDatatable_index_fetch_begin (Relation rel)
 
static void table_index_fetch_reset (struct IndexFetchTableData *scan)
 
static void table_index_fetch_end (struct IndexFetchTableData *scan)
 
static bool table_index_fetch_tuple (struct IndexFetchTableData *scan, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot, bool *call_again, bool *all_dead)
 
bool table_index_fetch_tuple_check (Relation rel, ItemPointer tid, Snapshot snapshot, bool *all_dead)
 
static bool table_tuple_fetch_row_version (Relation rel, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot)
 
static bool table_tuple_tid_valid (TableScanDesc scan, ItemPointer tid)
 
void table_tuple_get_latest_tid (TableScanDesc scan, ItemPointer tid)
 
static bool table_tuple_satisfies_snapshot (Relation rel, TupleTableSlot *slot, Snapshot snapshot)
 
static TransactionId table_index_delete_tuples (Relation rel, TM_IndexDeleteOp *delstate)
 
static void table_tuple_insert (Relation rel, TupleTableSlot *slot, CommandId cid, int options, BulkInsertStateData *bistate)
 
static void table_tuple_insert_speculative (Relation rel, TupleTableSlot *slot, CommandId cid, int options, BulkInsertStateData *bistate, uint32 specToken)
 
static void table_tuple_complete_speculative (Relation rel, TupleTableSlot *slot, uint32 specToken, bool succeeded)
 
static void table_multi_insert (Relation rel, TupleTableSlot **slots, int nslots, CommandId cid, int options, BulkInsertStateData *bistate)
 
static TM_Result table_tuple_delete (Relation rel, ItemPointer tid, CommandId cid, Snapshot snapshot, Snapshot crosscheck, bool wait, TM_FailureData *tmfd, bool changingPart)
 
static TM_Result table_tuple_update (Relation rel, ItemPointer otid, TupleTableSlot *slot, CommandId cid, Snapshot snapshot, Snapshot crosscheck, bool wait, TM_FailureData *tmfd, LockTupleMode *lockmode, TU_UpdateIndexes *update_indexes)
 
static TM_Result table_tuple_lock (Relation rel, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot, CommandId cid, LockTupleMode mode, LockWaitPolicy wait_policy, uint8 flags, TM_FailureData *tmfd)
 
static void table_finish_bulk_insert (Relation rel, int options)
 
static void table_relation_set_new_filelocator (Relation rel, const RelFileLocator *newrlocator, char persistence, TransactionId *freezeXid, MultiXactId *minmulti)
 
static void table_relation_nontransactional_truncate (Relation rel)
 
static void table_relation_copy_data (Relation rel, const RelFileLocator *newrlocator)
 
static void table_relation_copy_for_cluster (Relation OldTable, Relation NewTable, Relation OldIndex, bool use_sort, TransactionId OldestXmin, TransactionId *xid_cutoff, MultiXactId *multi_cutoff, double *num_tuples, double *tups_vacuumed, double *tups_recently_dead)
 
static void table_relation_vacuum (Relation rel, const VacuumParams params, BufferAccessStrategy bstrategy)
 
static bool table_scan_analyze_next_block (TableScanDesc scan, ReadStream *stream)
 
static bool table_scan_analyze_next_tuple (TableScanDesc scan, TransactionId OldestXmin, double *liverows, double *deadrows, TupleTableSlot *slot)
 
static double table_index_build_scan (Relation table_rel, Relation index_rel, IndexInfo *index_info, bool allow_sync, bool progress, IndexBuildCallback callback, void *callback_state, TableScanDesc scan)
 
static double table_index_build_range_scan (Relation table_rel, Relation index_rel, IndexInfo *index_info, bool allow_sync, bool anyvisible, bool progress, BlockNumber start_blockno, BlockNumber numblocks, IndexBuildCallback callback, void *callback_state, TableScanDesc scan)
 
static void table_index_validate_scan (Relation table_rel, Relation index_rel, IndexInfo *index_info, Snapshot snapshot, ValidateIndexState *state)
 
static uint64 table_relation_size (Relation rel, ForkNumber forkNumber)
 
static bool table_relation_needs_toast_table (Relation rel)
 
static Oid table_relation_toast_am (Relation rel)
 
static void table_relation_fetch_toast_slice (Relation toastrel, Oid valueid, int32 attrsize, int32 sliceoffset, int32 slicelength, struct varlena *result)
 
static void table_relation_estimate_size (Relation rel, int32 *attr_widths, BlockNumber *pages, double *tuples, double *allvisfrac)
 
static bool table_scan_bitmap_next_tuple (TableScanDesc scan, TupleTableSlot *slot, bool *recheck, uint64 *lossy_pages, uint64 *exact_pages)
 
static bool table_scan_sample_next_block (TableScanDesc scan, SampleScanState *scanstate)
 
static bool table_scan_sample_next_tuple (TableScanDesc scan, SampleScanState *scanstate, TupleTableSlot *slot)
 
void simple_table_tuple_insert (Relation rel, TupleTableSlot *slot)
 
void simple_table_tuple_delete (Relation rel, ItemPointer tid, Snapshot snapshot)
 
void simple_table_tuple_update (Relation rel, ItemPointer otid, TupleTableSlot *slot, Snapshot snapshot, TU_UpdateIndexes *update_indexes)
 
Size table_block_parallelscan_estimate (Relation rel)
 
Size table_block_parallelscan_initialize (Relation rel, ParallelTableScanDesc pscan)
 
void table_block_parallelscan_reinitialize (Relation rel, ParallelTableScanDesc pscan)
 
BlockNumber table_block_parallelscan_nextpage (Relation rel, ParallelBlockTableScanWorker pbscanwork, ParallelBlockTableScanDesc pbscan)
 
void table_block_parallelscan_startblock_init (Relation rel, ParallelBlockTableScanWorker pbscanwork, ParallelBlockTableScanDesc pbscan, BlockNumber startblock, BlockNumber numblocks)
 
uint64 table_block_relation_size (Relation rel, ForkNumber forkNumber)
 
void table_block_relation_estimate_size (Relation rel, int32 *attr_widths, BlockNumber *pages, double *tuples, double *allvisfrac, Size overhead_bytes_per_tuple, Size usable_bytes_per_page)
 
const TableAmRoutineGetTableAmRoutine (Oid amhandler)
 
const TableAmRoutineGetHeapamTableAmRoutine (void)
 

Variables

PGDLLIMPORT char * default_table_access_method
 
PGDLLIMPORT bool synchronize_seqscans
 

Macro Definition Documentation

◆ DEFAULT_TABLE_ACCESS_METHOD

#define DEFAULT_TABLE_ACCESS_METHOD   "heap"

Definition at line 30 of file tableam.h.

◆ TABLE_INSERT_FROZEN

#define TABLE_INSERT_FROZEN   0x0004

Definition at line 260 of file tableam.h.

◆ TABLE_INSERT_NO_LOGICAL

#define TABLE_INSERT_NO_LOGICAL   0x0008

Definition at line 261 of file tableam.h.

◆ TABLE_INSERT_SKIP_FSM

#define TABLE_INSERT_SKIP_FSM   0x0002

Definition at line 259 of file tableam.h.

◆ TUPLE_LOCK_FLAG_FIND_LAST_VERSION

#define TUPLE_LOCK_FLAG_FIND_LAST_VERSION   (1 << 1)

Definition at line 267 of file tableam.h.

◆ TUPLE_LOCK_FLAG_LOCK_UPDATE_IN_PROGRESS

#define TUPLE_LOCK_FLAG_LOCK_UPDATE_IN_PROGRESS   (1 << 0)

Definition at line 265 of file tableam.h.

Typedef Documentation

◆ BulkInsertStateData

Definition at line 38 of file tableam.h.

◆ IndexBuildCallback

typedef void(* IndexBuildCallback) (Relation index, ItemPointer tid, Datum *values, bool *isnull, bool tupleIsAlive, void *state)

Definition at line 271 of file tableam.h.

◆ IndexInfo

typedef struct IndexInfo IndexInfo

Definition at line 39 of file tableam.h.

◆ SampleScanState

Definition at line 40 of file tableam.h.

◆ ScanOptions

typedef enum ScanOptions ScanOptions

◆ TableAmRoutine

◆ TM_FailureData

◆ TM_IndexDelete

◆ TM_IndexDeleteOp

◆ TM_IndexStatus

◆ TM_Result

typedef enum TM_Result TM_Result

◆ TU_UpdateIndexes

◆ ValidateIndexState

Definition at line 41 of file tableam.h.

Enumeration Type Documentation

◆ ScanOptions

Enumerator
SO_TYPE_SEQSCAN 
SO_TYPE_BITMAPSCAN 
SO_TYPE_SAMPLESCAN 
SO_TYPE_TIDSCAN 
SO_TYPE_TIDRANGESCAN 
SO_TYPE_ANALYZE 
SO_ALLOW_STRAT 
SO_ALLOW_SYNC 
SO_ALLOW_PAGEMODE 
SO_TEMP_SNAPSHOT 

Definition at line 46 of file tableam.h.

47{
48 /* one of SO_TYPE_* may be specified */
49 SO_TYPE_SEQSCAN = 1 << 0,
50 SO_TYPE_BITMAPSCAN = 1 << 1,
51 SO_TYPE_SAMPLESCAN = 1 << 2,
52 SO_TYPE_TIDSCAN = 1 << 3,
53 SO_TYPE_TIDRANGESCAN = 1 << 4,
54 SO_TYPE_ANALYZE = 1 << 5,
55
56 /* several of SO_ALLOW_* may be specified */
57 /* allow or disallow use of access strategy */
58 SO_ALLOW_STRAT = 1 << 6,
59 /* report location to syncscan logic? */
60 SO_ALLOW_SYNC = 1 << 7,
61 /* verify visibility page-at-a-time? */
62 SO_ALLOW_PAGEMODE = 1 << 8,
63
64 /* unregister snapshot at scan end? */
65 SO_TEMP_SNAPSHOT = 1 << 9,
ScanOptions
Definition: tableam.h:47
@ SO_ALLOW_STRAT
Definition: tableam.h:58
@ SO_TYPE_TIDRANGESCAN
Definition: tableam.h:53
@ SO_TYPE_ANALYZE
Definition: tableam.h:54
@ SO_TEMP_SNAPSHOT
Definition: tableam.h:65
@ SO_TYPE_TIDSCAN
Definition: tableam.h:52
@ SO_ALLOW_PAGEMODE
Definition: tableam.h:62
@ SO_TYPE_SAMPLESCAN
Definition: tableam.h:51
@ SO_ALLOW_SYNC
Definition: tableam.h:60
@ SO_TYPE_SEQSCAN
Definition: tableam.h:49
@ SO_TYPE_BITMAPSCAN
Definition: tableam.h:50

◆ TM_Result

enum TM_Result
Enumerator
TM_Ok 
TM_Invisible 
TM_SelfModified 
TM_Updated 
TM_Deleted 
TM_BeingModified 
TM_WouldBlock 

Definition at line 72 of file tableam.h.

73{
74 /*
75 * Signals that the action succeeded (i.e. update/delete performed, lock
76 * was acquired)
77 */
78 TM_Ok,
79
80 /* The affected tuple wasn't visible to the relevant snapshot */
82
83 /* The affected tuple was already modified by the calling backend */
85
86 /*
87 * The affected tuple was updated by another transaction. This includes
88 * the case where tuple was moved to another partition.
89 */
91
92 /* The affected tuple was deleted by another transaction */
94
95 /*
96 * The affected tuple is currently being modified by another session. This
97 * will only be returned if table_(update/delete/lock_tuple) are
98 * instructed not to wait.
99 */
101
102 /* lock couldn't be acquired, action skipped. Only used by lock_tuple */
104} TM_Result;
TM_Result
Definition: tableam.h:73
@ TM_Ok
Definition: tableam.h:78
@ TM_BeingModified
Definition: tableam.h:100
@ TM_Deleted
Definition: tableam.h:93
@ TM_WouldBlock
Definition: tableam.h:103
@ TM_Updated
Definition: tableam.h:90
@ TM_SelfModified
Definition: tableam.h:84
@ TM_Invisible
Definition: tableam.h:81

◆ TU_UpdateIndexes

Enumerator
TU_None 
TU_All 
TU_Summarizing 

Definition at line 110 of file tableam.h.

111{
112 /* No indexed columns were updated (incl. TID addressing of tuple) */
113 TU_None,
114
115 /* A non-summarizing indexed column was updated, or the TID has changed */
116 TU_All,
117
118 /* Only summarized columns were updated, TID is unchanged */
TU_UpdateIndexes
Definition: tableam.h:111
@ TU_Summarizing
Definition: tableam.h:119
@ TU_All
Definition: tableam.h:116
@ TU_None
Definition: tableam.h:113

Function Documentation

◆ GetHeapamTableAmRoutine()

const TableAmRoutine * GetHeapamTableAmRoutine ( void  )

Definition at line 2676 of file heapam_handler.c.

2677{
2678 return &heapam_methods;
2679}
static const TableAmRoutine heapam_methods

References heapam_methods.

Referenced by formrdesc(), and heap_getnext().

◆ GetTableAmRoutine()

const TableAmRoutine * GetTableAmRoutine ( Oid  amhandler)

Definition at line 28 of file tableamapi.c.

29{
30 Datum datum;
31 const TableAmRoutine *routine;
32
33 datum = OidFunctionCall0(amhandler);
34 routine = (TableAmRoutine *) DatumGetPointer(datum);
35
36 if (routine == NULL || !IsA(routine, TableAmRoutine))
37 elog(ERROR, "table access method handler %u did not return a TableAmRoutine struct",
38 amhandler);
39
40 /*
41 * Assert that all required callbacks are present. That makes it a bit
42 * easier to keep AMs up to date, e.g. when forward porting them to a new
43 * major version.
44 */
45 Assert(routine->scan_begin != NULL);
46 Assert(routine->scan_end != NULL);
47 Assert(routine->scan_rescan != NULL);
48 Assert(routine->scan_getnextslot != NULL);
49
50 Assert(routine->parallelscan_estimate != NULL);
51 Assert(routine->parallelscan_initialize != NULL);
52 Assert(routine->parallelscan_reinitialize != NULL);
53
54 Assert(routine->index_fetch_begin != NULL);
55 Assert(routine->index_fetch_reset != NULL);
56 Assert(routine->index_fetch_end != NULL);
57 Assert(routine->index_fetch_tuple != NULL);
58
59 Assert(routine->tuple_fetch_row_version != NULL);
60 Assert(routine->tuple_tid_valid != NULL);
61 Assert(routine->tuple_get_latest_tid != NULL);
62 Assert(routine->tuple_satisfies_snapshot != NULL);
63 Assert(routine->index_delete_tuples != NULL);
64
65 Assert(routine->tuple_insert != NULL);
66
67 /*
68 * Could be made optional, but would require throwing error during
69 * parse-analysis.
70 */
71 Assert(routine->tuple_insert_speculative != NULL);
72 Assert(routine->tuple_complete_speculative != NULL);
73
74 Assert(routine->multi_insert != NULL);
75 Assert(routine->tuple_delete != NULL);
76 Assert(routine->tuple_update != NULL);
77 Assert(routine->tuple_lock != NULL);
78
79 Assert(routine->relation_set_new_filelocator != NULL);
81 Assert(routine->relation_copy_data != NULL);
82 Assert(routine->relation_copy_for_cluster != NULL);
83 Assert(routine->relation_vacuum != NULL);
84 Assert(routine->scan_analyze_next_block != NULL);
85 Assert(routine->scan_analyze_next_tuple != NULL);
86 Assert(routine->index_build_range_scan != NULL);
87 Assert(routine->index_validate_scan != NULL);
88
89 Assert(routine->relation_size != NULL);
90 Assert(routine->relation_needs_toast_table != NULL);
91
92 Assert(routine->relation_estimate_size != NULL);
93
94 Assert(routine->scan_sample_next_block != NULL);
95 Assert(routine->scan_sample_next_tuple != NULL);
96
97 return routine;
98}
#define ERROR
Definition: elog.h:39
#define elog(elevel,...)
Definition: elog.h:226
#define OidFunctionCall0(functionId)
Definition: fmgr.h:718
Assert(PointerIsAligned(start, uint64))
#define IsA(nodeptr, _type_)
Definition: nodes.h:164
uint64_t Datum
Definition: postgres.h:70
static Pointer DatumGetPointer(Datum X)
Definition: postgres.h:322
Size(* parallelscan_initialize)(Relation rel, ParallelTableScanDesc pscan)
Definition: tableam.h:399
void(* relation_copy_data)(Relation rel, const RelFileLocator *newrlocator)
Definition: tableam.h:623
void(* index_fetch_reset)(struct IndexFetchTableData *data)
Definition: tableam.h:429
TableScanDesc(* scan_begin)(Relation rel, Snapshot snapshot, int nkeys, ScanKeyData *key, ParallelTableScanDesc pscan, uint32 flags)
Definition: tableam.h:327
void(* tuple_complete_speculative)(Relation rel, TupleTableSlot *slot, uint32 specToken, bool succeeded)
Definition: tableam.h:523
void(* parallelscan_reinitialize)(Relation rel, ParallelTableScanDesc pscan)
Definition: tableam.h:406
bool(* scan_sample_next_tuple)(TableScanDesc scan, SampleScanState *scanstate, TupleTableSlot *slot)
Definition: tableam.h:840
bool(* scan_sample_next_block)(TableScanDesc scan, SampleScanState *scanstate)
Definition: tableam.h:824
void(* tuple_get_latest_tid)(TableScanDesc scan, ItemPointer tid)
Definition: tableam.h:488
void(* relation_copy_for_cluster)(Relation OldTable, Relation NewTable, Relation OldIndex, bool use_sort, TransactionId OldestXmin, TransactionId *xid_cutoff, MultiXactId *multi_cutoff, double *num_tuples, double *tups_vacuumed, double *tups_recently_dead)
Definition: tableam.h:627
void(* relation_estimate_size)(Relation rel, int32 *attr_widths, BlockNumber *pages, double *tuples, double *allvisfrac)
Definition: tableam.h:771
bool(* relation_needs_toast_table)(Relation rel)
Definition: tableam.h:735
bool(* tuple_tid_valid)(TableScanDesc scan, ItemPointer tid)
Definition: tableam.h:481
void(* scan_end)(TableScanDesc scan)
Definition: tableam.h:337
uint64(* relation_size)(Relation rel, ForkNumber forkNumber)
Definition: tableam.h:725
TM_Result(* tuple_lock)(Relation rel, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot, CommandId cid, LockTupleMode mode, LockWaitPolicy wait_policy, uint8 flags, TM_FailureData *tmfd)
Definition: tableam.h:555
void(* relation_nontransactional_truncate)(Relation rel)
Definition: tableam.h:615
TM_Result(* tuple_update)(Relation rel, ItemPointer otid, TupleTableSlot *slot, CommandId cid, Snapshot snapshot, Snapshot crosscheck, bool wait, TM_FailureData *tmfd, LockTupleMode *lockmode, TU_UpdateIndexes *update_indexes)
Definition: tableam.h:543
bool(* tuple_fetch_row_version)(Relation rel, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot)
Definition: tableam.h:473
bool(* scan_analyze_next_block)(TableScanDesc scan, ReadStream *stream)
Definition: tableam.h:674
Size(* parallelscan_estimate)(Relation rel)
Definition: tableam.h:392
void(* relation_set_new_filelocator)(Relation rel, const RelFileLocator *newrlocator, char persistence, TransactionId *freezeXid, MultiXactId *minmulti)
Definition: tableam.h:601
void(* scan_rescan)(TableScanDesc scan, ScanKeyData *key, bool set_params, bool allow_strat, bool allow_sync, bool allow_pagemode)
Definition: tableam.h:343
struct IndexFetchTableData *(* index_fetch_begin)(Relation rel)
Definition: tableam.h:423
bool(* scan_analyze_next_tuple)(TableScanDesc scan, TransactionId OldestXmin, double *liverows, double *deadrows, TupleTableSlot *slot)
Definition: tableam.h:685
TransactionId(* index_delete_tuples)(Relation rel, TM_IndexDeleteOp *delstate)
Definition: tableam.h:500
void(* index_fetch_end)(struct IndexFetchTableData *data)
Definition: tableam.h:434
void(* tuple_insert_speculative)(Relation rel, TupleTableSlot *slot, CommandId cid, int options, BulkInsertStateData *bistate, uint32 specToken)
Definition: tableam.h:515
bool(* index_fetch_tuple)(struct IndexFetchTableData *scan, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot, bool *call_again, bool *all_dead)
Definition: tableam.h:456
TM_Result(* tuple_delete)(Relation rel, ItemPointer tid, CommandId cid, Snapshot snapshot, Snapshot crosscheck, bool wait, TM_FailureData *tmfd, bool changingPart)
Definition: tableam.h:533
double(* index_build_range_scan)(Relation table_rel, Relation index_rel, IndexInfo *index_info, bool allow_sync, bool anyvisible, bool progress, BlockNumber start_blockno, BlockNumber numblocks, IndexBuildCallback callback, void *callback_state, TableScanDesc scan)
Definition: tableam.h:692
void(* relation_vacuum)(Relation rel, const VacuumParams params, BufferAccessStrategy bstrategy)
Definition: tableam.h:653
void(* multi_insert)(Relation rel, TupleTableSlot **slots, int nslots, CommandId cid, int options, BulkInsertStateData *bistate)
Definition: tableam.h:529
void(* index_validate_scan)(Relation table_rel, Relation index_rel, IndexInfo *index_info, Snapshot snapshot, ValidateIndexState *state)
Definition: tableam.h:705
bool(* scan_getnextslot)(TableScanDesc scan, ScanDirection direction, TupleTableSlot *slot)
Definition: tableam.h:350
void(* tuple_insert)(Relation rel, TupleTableSlot *slot, CommandId cid, int options, BulkInsertStateData *bistate)
Definition: tableam.h:510
bool(* tuple_satisfies_snapshot)(Relation rel, TupleTableSlot *slot, Snapshot snapshot)
Definition: tableam.h:495

References Assert(), DatumGetPointer(), elog, ERROR, TableAmRoutine::index_build_range_scan, TableAmRoutine::index_delete_tuples, TableAmRoutine::index_fetch_begin, TableAmRoutine::index_fetch_end, TableAmRoutine::index_fetch_reset, TableAmRoutine::index_fetch_tuple, TableAmRoutine::index_validate_scan, IsA, TableAmRoutine::multi_insert, OidFunctionCall0, TableAmRoutine::parallelscan_estimate, TableAmRoutine::parallelscan_initialize, TableAmRoutine::parallelscan_reinitialize, TableAmRoutine::relation_copy_data, TableAmRoutine::relation_copy_for_cluster, TableAmRoutine::relation_estimate_size, TableAmRoutine::relation_needs_toast_table, TableAmRoutine::relation_nontransactional_truncate, TableAmRoutine::relation_set_new_filelocator, TableAmRoutine::relation_size, TableAmRoutine::relation_vacuum, TableAmRoutine::scan_analyze_next_block, TableAmRoutine::scan_analyze_next_tuple, TableAmRoutine::scan_begin, TableAmRoutine::scan_end, TableAmRoutine::scan_getnextslot, TableAmRoutine::scan_rescan, TableAmRoutine::scan_sample_next_block, TableAmRoutine::scan_sample_next_tuple, TableAmRoutine::tuple_complete_speculative, TableAmRoutine::tuple_delete, TableAmRoutine::tuple_fetch_row_version, TableAmRoutine::tuple_get_latest_tid, TableAmRoutine::tuple_insert, TableAmRoutine::tuple_insert_speculative, TableAmRoutine::tuple_lock, TableAmRoutine::tuple_satisfies_snapshot, TableAmRoutine::tuple_tid_valid, and TableAmRoutine::tuple_update.

Referenced by InitTableAmRoutine().

◆ simple_table_tuple_delete()

void simple_table_tuple_delete ( Relation  rel,
ItemPointer  tid,
Snapshot  snapshot 
)

Definition at line 322 of file tableam.c.

323{
324 TM_Result result;
325 TM_FailureData tmfd;
326
327 result = table_tuple_delete(rel, tid,
329 snapshot, InvalidSnapshot,
330 true /* wait for commit */ ,
331 &tmfd, false /* changingPart */ );
332
333 switch (result)
334 {
335 case TM_SelfModified:
336 /* Tuple was already updated in current command? */
337 elog(ERROR, "tuple already updated by self");
338 break;
339
340 case TM_Ok:
341 /* done successfully */
342 break;
343
344 case TM_Updated:
345 elog(ERROR, "tuple concurrently updated");
346 break;
347
348 case TM_Deleted:
349 elog(ERROR, "tuple concurrently deleted");
350 break;
351
352 default:
353 elog(ERROR, "unrecognized table_tuple_delete status: %u", result);
354 break;
355 }
356}
#define InvalidSnapshot
Definition: snapshot.h:119
static TM_Result table_tuple_delete(Relation rel, ItemPointer tid, CommandId cid, Snapshot snapshot, Snapshot crosscheck, bool wait, TM_FailureData *tmfd, bool changingPart)
Definition: tableam.h:1467
CommandId GetCurrentCommandId(bool used)
Definition: xact.c:830

References elog, ERROR, GetCurrentCommandId(), InvalidSnapshot, table_tuple_delete(), TM_Deleted, TM_Ok, TM_SelfModified, and TM_Updated.

Referenced by ExecSimpleRelationDelete().

◆ simple_table_tuple_insert()

void simple_table_tuple_insert ( Relation  rel,
TupleTableSlot slot 
)

Definition at line 308 of file tableam.c.

309{
310 table_tuple_insert(rel, slot, GetCurrentCommandId(true), 0, NULL);
311}
static void table_tuple_insert(Relation rel, TupleTableSlot *slot, CommandId cid, int options, BulkInsertStateData *bistate)
Definition: tableam.h:1377

References GetCurrentCommandId(), and table_tuple_insert().

Referenced by ExecSimpleRelationInsert().

◆ simple_table_tuple_update()

void simple_table_tuple_update ( Relation  rel,
ItemPointer  otid,
TupleTableSlot slot,
Snapshot  snapshot,
TU_UpdateIndexes update_indexes 
)

Definition at line 367 of file tableam.c.

371{
372 TM_Result result;
373 TM_FailureData tmfd;
374 LockTupleMode lockmode;
375
376 result = table_tuple_update(rel, otid, slot,
378 snapshot, InvalidSnapshot,
379 true /* wait for commit */ ,
380 &tmfd, &lockmode, update_indexes);
381
382 switch (result)
383 {
384 case TM_SelfModified:
385 /* Tuple was already updated in current command? */
386 elog(ERROR, "tuple already updated by self");
387 break;
388
389 case TM_Ok:
390 /* done successfully */
391 break;
392
393 case TM_Updated:
394 elog(ERROR, "tuple concurrently updated");
395 break;
396
397 case TM_Deleted:
398 elog(ERROR, "tuple concurrently deleted");
399 break;
400
401 default:
402 elog(ERROR, "unrecognized table_tuple_update status: %u", result);
403 break;
404 }
405}
LockTupleMode
Definition: lockoptions.h:50
static TM_Result table_tuple_update(Relation rel, ItemPointer otid, TupleTableSlot *slot, CommandId cid, Snapshot snapshot, Snapshot crosscheck, bool wait, TM_FailureData *tmfd, LockTupleMode *lockmode, TU_UpdateIndexes *update_indexes)
Definition: tableam.h:1512

References elog, ERROR, GetCurrentCommandId(), InvalidSnapshot, table_tuple_update(), TM_Deleted, TM_Ok, TM_SelfModified, and TM_Updated.

Referenced by ExecSimpleRelationUpdate().

◆ table_beginscan()

◆ table_beginscan_analyze()

static TableScanDesc table_beginscan_analyze ( Relation  rel)
inlinestatic

Definition at line 974 of file tableam.h.

975{
976 uint32 flags = SO_TYPE_ANALYZE;
977
978 return rel->rd_tableam->scan_begin(rel, NULL, 0, NULL, NULL, flags);
979}

References RelationData::rd_tableam, TableAmRoutine::scan_begin, and SO_TYPE_ANALYZE.

Referenced by acquire_sample_rows().

◆ table_beginscan_bm()

static TableScanDesc table_beginscan_bm ( Relation  rel,
Snapshot  snapshot,
int  nkeys,
ScanKeyData key 
)
inlinestatic

Definition at line 921 of file tableam.h.

923{
925
926 return rel->rd_tableam->scan_begin(rel, snapshot, nkeys, key,
927 NULL, flags);
928}

References sort-test::key, RelationData::rd_tableam, TableAmRoutine::scan_begin, SO_ALLOW_PAGEMODE, and SO_TYPE_BITMAPSCAN.

Referenced by BitmapTableScanSetup().

◆ table_beginscan_catalog()

TableScanDesc table_beginscan_catalog ( Relation  relation,
int  nkeys,
ScanKeyData key 
)

Definition at line 113 of file tableam.c.

114{
115 uint32 flags = SO_TYPE_SEQSCAN |
117 Oid relid = RelationGetRelid(relation);
119
120 return relation->rd_tableam->scan_begin(relation, snapshot, nkeys, key,
121 NULL, flags);
122}
unsigned int Oid
Definition: postgres_ext.h:32
#define RelationGetRelid(relation)
Definition: rel.h:515
Snapshot GetCatalogSnapshot(Oid relid)
Definition: snapmgr.c:385
Snapshot RegisterSnapshot(Snapshot snapshot)
Definition: snapmgr.c:824

References GetCatalogSnapshot(), sort-test::key, RelationData::rd_tableam, RegisterSnapshot(), RelationGetRelid, TableAmRoutine::scan_begin, SO_ALLOW_PAGEMODE, SO_ALLOW_STRAT, SO_ALLOW_SYNC, SO_TEMP_SNAPSHOT, and SO_TYPE_SEQSCAN.

Referenced by AlterTableMoveAll(), AlterTableSpaceOptions(), check_db_file_conflict(), CreateDatabaseUsingFileCopy(), do_autovacuum(), DropSetting(), DropTableSpace(), find_typed_table_dependencies(), get_all_vacuum_rels(), get_database_list(), get_subscription_list(), get_tables_to_cluster(), get_tablespace_name(), get_tablespace_oid(), GetAllPublicationRelations(), getRelationsInNamespace(), GetSchemaPublicationRelations(), objectsInSchemaToOids(), populate_typ_list(), ReindexMultipleTables(), remove_dbtablespaces(), RemoveSubscriptionRel(), RenameTableSpace(), ThereIsAtLeastOneRole(), and vac_truncate_clog().

◆ table_beginscan_parallel()

TableScanDesc table_beginscan_parallel ( Relation  relation,
ParallelTableScanDesc  pscan 
)

Definition at line 166 of file tableam.c.

167{
168 Snapshot snapshot;
169 uint32 flags = SO_TYPE_SEQSCAN |
171
173
174 if (!pscan->phs_snapshot_any)
175 {
176 /* Snapshot was serialized -- restore it */
177 snapshot = RestoreSnapshot((char *) pscan + pscan->phs_snapshot_off);
178 RegisterSnapshot(snapshot);
179 flags |= SO_TEMP_SNAPSHOT;
180 }
181 else
182 {
183 /* SnapshotAny passed by caller (not serialized) */
184 snapshot = SnapshotAny;
185 }
186
187 return relation->rd_tableam->scan_begin(relation, snapshot, 0, NULL,
188 pscan, flags);
189}
#define RelFileLocatorEquals(locator1, locator2)
Snapshot RestoreSnapshot(char *start_address)
Definition: snapmgr.c:1793
#define SnapshotAny
Definition: snapmgr.h:33
RelFileLocator phs_locator
Definition: relscan.h:82
RelFileLocator rd_locator
Definition: rel.h:57

References Assert(), ParallelTableScanDescData::phs_locator, ParallelTableScanDescData::phs_snapshot_any, ParallelTableScanDescData::phs_snapshot_off, RelationData::rd_locator, RelationData::rd_tableam, RegisterSnapshot(), RelFileLocatorEquals, RestoreSnapshot(), TableAmRoutine::scan_begin, SnapshotAny, SO_ALLOW_PAGEMODE, SO_ALLOW_STRAT, SO_ALLOW_SYNC, SO_TEMP_SNAPSHOT, and SO_TYPE_SEQSCAN.

Referenced by _brin_parallel_scan_and_build(), _bt_parallel_scan_and_sort(), _gin_parallel_scan_and_build(), ExecSeqScanInitializeDSM(), and ExecSeqScanInitializeWorker().

◆ table_beginscan_parallel_tidrange()

TableScanDesc table_beginscan_parallel_tidrange ( Relation  relation,
ParallelTableScanDesc  pscan 
)

Definition at line 192 of file tableam.c.

194{
195 Snapshot snapshot;
197 TableScanDesc sscan;
198
200
201 /* disable syncscan in parallel tid range scan. */
202 pscan->phs_syncscan = false;
203
204 if (!pscan->phs_snapshot_any)
205 {
206 /* Snapshot was serialized -- restore it */
207 snapshot = RestoreSnapshot((char *) pscan + pscan->phs_snapshot_off);
208 RegisterSnapshot(snapshot);
209 flags |= SO_TEMP_SNAPSHOT;
210 }
211 else
212 {
213 /* SnapshotAny passed by caller (not serialized) */
214 snapshot = SnapshotAny;
215 }
216
217 sscan = relation->rd_tableam->scan_begin(relation, snapshot, 0, NULL,
218 pscan, flags);
219 return sscan;
220}

References Assert(), ParallelTableScanDescData::phs_locator, ParallelTableScanDescData::phs_snapshot_any, ParallelTableScanDescData::phs_snapshot_off, ParallelTableScanDescData::phs_syncscan, RelationData::rd_locator, RelationData::rd_tableam, RegisterSnapshot(), RelFileLocatorEquals, RestoreSnapshot(), TableAmRoutine::scan_begin, SnapshotAny, SO_ALLOW_PAGEMODE, SO_TEMP_SNAPSHOT, and SO_TYPE_TIDRANGESCAN.

Referenced by ExecTidRangeScanInitializeDSM(), and ExecTidRangeScanInitializeWorker().

◆ table_beginscan_sampling()

static TableScanDesc table_beginscan_sampling ( Relation  rel,
Snapshot  snapshot,
int  nkeys,
ScanKeyData key,
bool  allow_strat,
bool  allow_sync,
bool  allow_pagemode 
)
inlinestatic

Definition at line 938 of file tableam.h.

942{
944
945 if (allow_strat)
946 flags |= SO_ALLOW_STRAT;
947 if (allow_sync)
948 flags |= SO_ALLOW_SYNC;
949 if (allow_pagemode)
950 flags |= SO_ALLOW_PAGEMODE;
951
952 return rel->rd_tableam->scan_begin(rel, snapshot, nkeys, key, NULL, flags);
953}

References sort-test::key, RelationData::rd_tableam, TableAmRoutine::scan_begin, SO_ALLOW_PAGEMODE, SO_ALLOW_STRAT, SO_ALLOW_SYNC, and SO_TYPE_SAMPLESCAN.

Referenced by tablesample_init().

◆ table_beginscan_strat()

static TableScanDesc table_beginscan_strat ( Relation  rel,
Snapshot  snapshot,
int  nkeys,
ScanKeyData key,
bool  allow_strat,
bool  allow_sync 
)
inlinestatic

Definition at line 900 of file tableam.h.

903{
905
906 if (allow_strat)
907 flags |= SO_ALLOW_STRAT;
908 if (allow_sync)
909 flags |= SO_ALLOW_SYNC;
910
911 return rel->rd_tableam->scan_begin(rel, snapshot, nkeys, key, NULL, flags);
912}

References sort-test::key, RelationData::rd_tableam, TableAmRoutine::scan_begin, SO_ALLOW_PAGEMODE, SO_ALLOW_STRAT, SO_ALLOW_SYNC, and SO_TYPE_SEQSCAN.

Referenced by bt_check_every_level(), heapam_index_build_range_scan(), heapam_index_validate_scan(), IndexCheckExclusion(), pgstat_heap(), and systable_beginscan().

◆ table_beginscan_tid()

static TableScanDesc table_beginscan_tid ( Relation  rel,
Snapshot  snapshot 
)
inlinestatic

Definition at line 961 of file tableam.h.

962{
963 uint32 flags = SO_TYPE_TIDSCAN;
964
965 return rel->rd_tableam->scan_begin(rel, snapshot, 0, NULL, NULL, flags);
966}

References RelationData::rd_tableam, TableAmRoutine::scan_begin, and SO_TYPE_TIDSCAN.

Referenced by currtid_internal(), and TidListEval().

◆ table_beginscan_tidrange()

static TableScanDesc table_beginscan_tidrange ( Relation  rel,
Snapshot  snapshot,
ItemPointer  mintid,
ItemPointer  maxtid 
)
inlinestatic

Definition at line 1049 of file tableam.h.

1052{
1053 TableScanDesc sscan;
1055
1056 sscan = rel->rd_tableam->scan_begin(rel, snapshot, 0, NULL, NULL, flags);
1057
1058 /* Set the range of TIDs to scan */
1059 sscan->rs_rd->rd_tableam->scan_set_tidrange(sscan, mintid, maxtid);
1060
1061 return sscan;
1062}
void(* scan_set_tidrange)(TableScanDesc scan, ItemPointer mintid, ItemPointer maxtid)
Definition: tableam.h:371
Relation rs_rd
Definition: relscan.h:36

References RelationData::rd_tableam, TableScanDescData::rs_rd, TableAmRoutine::scan_begin, TableAmRoutine::scan_set_tidrange, SO_ALLOW_PAGEMODE, and SO_TYPE_TIDRANGESCAN.

Referenced by TidRangeNext().

◆ table_block_parallelscan_estimate()

Size table_block_parallelscan_estimate ( Relation  rel)

Definition at line 414 of file tableam.c.

415{
416 return sizeof(ParallelBlockTableScanDescData);
417}
struct ParallelBlockTableScanDescData ParallelBlockTableScanDescData

◆ table_block_parallelscan_initialize()

Size table_block_parallelscan_initialize ( Relation  rel,
ParallelTableScanDesc  pscan 
)

Definition at line 420 of file tableam.c.

421{
423
424 bpscan->base.phs_locator = rel->rd_locator;
426 /* compare phs_syncscan initialization to similar logic in initscan */
429 bpscan->phs_nblocks > NBuffers / 4;
430 SpinLockInit(&bpscan->phs_mutex);
434
435 return sizeof(ParallelBlockTableScanDescData);
436}
static void pg_atomic_init_u64(volatile pg_atomic_uint64 *ptr, uint64 val)
Definition: atomics.h:451
#define InvalidBlockNumber
Definition: block.h:33
#define RelationGetNumberOfBlocks(reln)
Definition: bufmgr.h:294
int NBuffers
Definition: globals.c:142
#define RelationUsesLocalBuffers(relation)
Definition: rel.h:647
struct ParallelBlockTableScanDescData * ParallelBlockTableScanDesc
Definition: relscan.h:104
#define SpinLockInit(lock)
Definition: spin.h:57
pg_atomic_uint64 phs_nallocated
Definition: relscan.h:101
ParallelTableScanDescData base
Definition: relscan.h:94
bool synchronize_seqscans
Definition: tableam.c:50

References ParallelBlockTableScanDescData::base, InvalidBlockNumber, NBuffers, pg_atomic_init_u64(), ParallelTableScanDescData::phs_locator, ParallelBlockTableScanDescData::phs_mutex, ParallelBlockTableScanDescData::phs_nallocated, ParallelBlockTableScanDescData::phs_nblocks, ParallelBlockTableScanDescData::phs_numblock, ParallelBlockTableScanDescData::phs_startblock, ParallelTableScanDescData::phs_syncscan, RelationData::rd_locator, RelationGetNumberOfBlocks, RelationUsesLocalBuffers, SpinLockInit, and synchronize_seqscans.

◆ table_block_parallelscan_nextpage()

BlockNumber table_block_parallelscan_nextpage ( Relation  rel,
ParallelBlockTableScanWorker  pbscanwork,
ParallelBlockTableScanDesc  pbscan 
)

Definition at line 554 of file tableam.c.

557{
558 BlockNumber scan_nblocks;
559 BlockNumber page;
560 uint64 nallocated;
561
562 /*
563 * The logic below allocates block numbers out to parallel workers in a
564 * way that each worker will receive a set of consecutive block numbers to
565 * scan. Earlier versions of this would allocate the next highest block
566 * number to the next worker to call this function. This would generally
567 * result in workers never receiving consecutive block numbers. Some
568 * operating systems would not detect the sequential I/O pattern due to
569 * each backend being a different process which could result in poor
570 * performance due to inefficient or no readahead. To work around this
571 * issue, we now allocate a range of block numbers for each worker and
572 * when they come back for another block, we give them the next one in
573 * that range until the range is complete. When the worker completes the
574 * range of blocks we then allocate another range for it and return the
575 * first block number from that range.
576 *
577 * Here we name these ranges of blocks "chunks". The initial size of
578 * these chunks is determined in table_block_parallelscan_startblock_init
579 * based on the number of blocks to scan. Towards the end of the scan, we
580 * start making reductions in the size of the chunks in order to attempt
581 * to divide the remaining work over all the workers as evenly as
582 * possible.
583 *
584 * Here pbscanwork is local worker memory. phsw_chunk_remaining tracks
585 * the number of blocks remaining in the chunk. When that reaches 0 then
586 * we must allocate a new chunk for the worker.
587 *
588 * phs_nallocated tracks how many blocks have been allocated to workers
589 * already. When phs_nallocated >= rs_nblocks, all blocks have been
590 * allocated.
591 *
592 * Because we use an atomic fetch-and-add to fetch the current value, the
593 * phs_nallocated counter will exceed rs_nblocks, because workers will
594 * still increment the value, when they try to allocate the next block but
595 * all blocks have been allocated already. The counter must be 64 bits
596 * wide because of that, to avoid wrapping around when scan_nblocks is
597 * close to 2^32.
598 *
599 * The actual block to return is calculated by adding the counter to the
600 * starting block number, modulo phs_nblocks.
601 */
602
603 /* First, figure out how many blocks we're planning on scanning */
604 if (pbscan->phs_numblock == InvalidBlockNumber)
605 scan_nblocks = pbscan->phs_nblocks;
606 else
607 scan_nblocks = pbscan->phs_numblock;
608
609 /*
610 * Now check if we have any remaining blocks in a previous chunk for this
611 * worker. We must consume all of the blocks from that before we allocate
612 * a new chunk to the worker.
613 */
614 if (pbscanwork->phsw_chunk_remaining > 0)
615 {
616 /*
617 * Give them the next block in the range and update the remaining
618 * number of blocks.
619 */
620 nallocated = ++pbscanwork->phsw_nallocated;
621 pbscanwork->phsw_chunk_remaining--;
622 }
623 else
624 {
625 /*
626 * When we've only got PARALLEL_SEQSCAN_RAMPDOWN_CHUNKS chunks
627 * remaining in the scan, we half the chunk size. Since we reduce the
628 * chunk size here, we'll hit this again after doing
629 * PARALLEL_SEQSCAN_RAMPDOWN_CHUNKS at the new size. After a few
630 * iterations of this, we'll end up doing the last few blocks with the
631 * chunk size set to 1.
632 */
633 if (pbscanwork->phsw_chunk_size > 1 &&
634 pbscanwork->phsw_nallocated > scan_nblocks -
636 pbscanwork->phsw_chunk_size >>= 1;
637
638 nallocated = pbscanwork->phsw_nallocated =
640 pbscanwork->phsw_chunk_size);
641
642 /*
643 * Set the remaining number of blocks in this chunk so that subsequent
644 * calls from this worker continue on with this chunk until it's done.
645 */
646 pbscanwork->phsw_chunk_remaining = pbscanwork->phsw_chunk_size - 1;
647 }
648
649 /* Check if we've run out of blocks to scan */
650 if (nallocated >= scan_nblocks)
651 page = InvalidBlockNumber; /* all blocks have been allocated */
652 else
653 page = (nallocated + pbscan->phs_startblock) % pbscan->phs_nblocks;
654
655 /*
656 * Report scan location. Normally, we report the current page number.
657 * When we reach the end of the scan, though, we report the starting page,
658 * not the ending page, just so the starting positions for later scans
659 * doesn't slew backwards. We only report the position at the end of the
660 * scan once, though: subsequent callers will report nothing.
661 */
662 if (pbscan->base.phs_syncscan)
663 {
664 if (page != InvalidBlockNumber)
665 ss_report_location(rel, page);
666 else if (nallocated == pbscan->phs_nblocks)
668 }
669
670 return page;
671}
static uint64 pg_atomic_fetch_add_u64(volatile pg_atomic_uint64 *ptr, int64 add_)
Definition: atomics.h:530
uint32 BlockNumber
Definition: block.h:31
uint64_t uint64
Definition: c.h:542
if(TABLE==NULL||TABLE_index==NULL)
Definition: isn.c:81
void ss_report_location(Relation rel, BlockNumber location)
Definition: syncscan.c:289
#define PARALLEL_SEQSCAN_RAMPDOWN_CHUNKS
Definition: tableam.c:44

References ParallelBlockTableScanDescData::base, if(), InvalidBlockNumber, PARALLEL_SEQSCAN_RAMPDOWN_CHUNKS, pg_atomic_fetch_add_u64(), ParallelBlockTableScanDescData::phs_nallocated, ParallelBlockTableScanDescData::phs_nblocks, ParallelBlockTableScanDescData::phs_numblock, ParallelBlockTableScanDescData::phs_startblock, ParallelTableScanDescData::phs_syncscan, ParallelBlockTableScanWorkerData::phsw_chunk_remaining, ParallelBlockTableScanWorkerData::phsw_chunk_size, ParallelBlockTableScanWorkerData::phsw_nallocated, and ss_report_location().

Referenced by heap_scan_stream_read_next_parallel().

◆ table_block_parallelscan_reinitialize()

void table_block_parallelscan_reinitialize ( Relation  rel,
ParallelTableScanDesc  pscan 
)

Definition at line 439 of file tableam.c.

440{
442
444}
static void pg_atomic_write_u64(volatile pg_atomic_uint64 *ptr, uint64 val)
Definition: atomics.h:483

References pg_atomic_write_u64(), and ParallelBlockTableScanDescData::phs_nallocated.

◆ table_block_parallelscan_startblock_init()

void table_block_parallelscan_startblock_init ( Relation  rel,
ParallelBlockTableScanWorker  pbscanwork,
ParallelBlockTableScanDesc  pbscan,
BlockNumber  startblock,
BlockNumber  numblocks 
)

Definition at line 459 of file tableam.c.

464{
465 BlockNumber sync_startpage = InvalidBlockNumber;
466 BlockNumber scan_nblocks;
467
468 /* Reset the state we use for controlling allocation size. */
469 memset(pbscanwork, 0, sizeof(*pbscanwork));
470
471 StaticAssertStmt(MaxBlockNumber <= 0xFFFFFFFE,
472 "pg_nextpower2_32 may be too small for non-standard BlockNumber width");
473
474retry:
475 /* Grab the spinlock. */
476 SpinLockAcquire(&pbscan->phs_mutex);
477
478 /*
479 * When the caller specified a limit on the number of blocks to scan, set
480 * that in the ParallelBlockTableScanDesc, if it's not been done by
481 * another worker already.
482 */
483 if (numblocks != InvalidBlockNumber &&
485 {
486 pbscan->phs_numblock = numblocks;
487 }
488
489 /*
490 * If the scan's phs_startblock has not yet been initialized, we must do
491 * so now. If a startblock was specified, start there, otherwise if this
492 * is not a synchronized scan, we just start at block 0, but if it is a
493 * synchronized scan, we must get the starting position from the
494 * synchronized scan machinery. We can't hold the spinlock while doing
495 * that, though, so release the spinlock, get the information we need, and
496 * retry. If nobody else has initialized the scan in the meantime, we'll
497 * fill in the value we fetched on the second time through.
498 */
499 if (pbscan->phs_startblock == InvalidBlockNumber)
500 {
501 if (startblock != InvalidBlockNumber)
502 pbscan->phs_startblock = startblock;
503 else if (!pbscan->base.phs_syncscan)
504 pbscan->phs_startblock = 0;
505 else if (sync_startpage != InvalidBlockNumber)
506 pbscan->phs_startblock = sync_startpage;
507 else
508 {
509 SpinLockRelease(&pbscan->phs_mutex);
510 sync_startpage = ss_get_location(rel, pbscan->phs_nblocks);
511 goto retry;
512 }
513 }
514 SpinLockRelease(&pbscan->phs_mutex);
515
516 /*
517 * Figure out how many blocks we're going to scan; either all of them, or
518 * just phs_numblock's worth, if a limit has been imposed.
519 */
520 if (pbscan->phs_numblock == InvalidBlockNumber)
521 scan_nblocks = pbscan->phs_nblocks;
522 else
523 scan_nblocks = pbscan->phs_numblock;
524
525 /*
526 * We determine the chunk size based on scan_nblocks. First we split
527 * scan_nblocks into PARALLEL_SEQSCAN_NCHUNKS chunks then we calculate the
528 * next highest power of 2 number of the result. This means we split the
529 * blocks we're scanning into somewhere between PARALLEL_SEQSCAN_NCHUNKS
530 * and PARALLEL_SEQSCAN_NCHUNKS / 2 chunks.
531 */
532 pbscanwork->phsw_chunk_size = pg_nextpower2_32(Max(scan_nblocks /
534
535 /*
536 * Ensure we don't go over the maximum chunk size with larger tables. This
537 * means we may get much more than PARALLEL_SEQSCAN_NCHUNKS for larger
538 * tables. Too large a chunk size has been shown to be detrimental to
539 * sequential scan performance.
540 */
541 pbscanwork->phsw_chunk_size = Min(pbscanwork->phsw_chunk_size,
543}
#define MaxBlockNumber
Definition: block.h:35
#define Min(x, y)
Definition: c.h:1006
#define Max(x, y)
Definition: c.h:1000
#define StaticAssertStmt(condition, errmessage)
Definition: c.h:940
static uint32 pg_nextpower2_32(uint32 num)
Definition: pg_bitutils.h:189
#define SpinLockRelease(lock)
Definition: spin.h:61
#define SpinLockAcquire(lock)
Definition: spin.h:59
BlockNumber ss_get_location(Relation rel, BlockNumber relnblocks)
Definition: syncscan.c:254
#define PARALLEL_SEQSCAN_MAX_CHUNK_SIZE
Definition: tableam.c:46
#define PARALLEL_SEQSCAN_NCHUNKS
Definition: tableam.c:42

References ParallelBlockTableScanDescData::base, InvalidBlockNumber, Max, MaxBlockNumber, Min, PARALLEL_SEQSCAN_MAX_CHUNK_SIZE, PARALLEL_SEQSCAN_NCHUNKS, pg_nextpower2_32(), ParallelBlockTableScanDescData::phs_mutex, ParallelBlockTableScanDescData::phs_nblocks, ParallelBlockTableScanDescData::phs_numblock, ParallelBlockTableScanDescData::phs_startblock, ParallelTableScanDescData::phs_syncscan, ParallelBlockTableScanWorkerData::phsw_chunk_size, SpinLockAcquire, SpinLockRelease, ss_get_location(), and StaticAssertStmt.

Referenced by heap_scan_stream_read_next_parallel().

◆ table_block_relation_estimate_size()

void table_block_relation_estimate_size ( Relation  rel,
int32 attr_widths,
BlockNumber pages,
double *  tuples,
double *  allvisfrac,
Size  overhead_bytes_per_tuple,
Size  usable_bytes_per_page 
)

Definition at line 724 of file tableam.c.

729{
730 BlockNumber curpages;
731 BlockNumber relpages;
732 double reltuples;
733 BlockNumber relallvisible;
734 double density;
735
736 /* it should have storage, so we can call the smgr */
737 curpages = RelationGetNumberOfBlocks(rel);
738
739 /* coerce values in pg_class to more desirable types */
740 relpages = (BlockNumber) rel->rd_rel->relpages;
741 reltuples = (double) rel->rd_rel->reltuples;
742 relallvisible = (BlockNumber) rel->rd_rel->relallvisible;
743
744 /*
745 * HACK: if the relation has never yet been vacuumed, use a minimum size
746 * estimate of 10 pages. The idea here is to avoid assuming a
747 * newly-created table is really small, even if it currently is, because
748 * that may not be true once some data gets loaded into it. Once a vacuum
749 * or analyze cycle has been done on it, it's more reasonable to believe
750 * the size is somewhat stable.
751 *
752 * (Note that this is only an issue if the plan gets cached and used again
753 * after the table has been filled. What we're trying to avoid is using a
754 * nestloop-type plan on a table that has grown substantially since the
755 * plan was made. Normally, autovacuum/autoanalyze will occur once enough
756 * inserts have happened and cause cached-plan invalidation; but that
757 * doesn't happen instantaneously, and it won't happen at all for cases
758 * such as temporary tables.)
759 *
760 * We test "never vacuumed" by seeing whether reltuples < 0.
761 *
762 * If the table has inheritance children, we don't apply this heuristic.
763 * Totally empty parent tables are quite common, so we should be willing
764 * to believe that they are empty.
765 */
766 if (curpages < 10 &&
767 reltuples < 0 &&
768 !rel->rd_rel->relhassubclass)
769 curpages = 10;
770
771 /* report estimated # pages */
772 *pages = curpages;
773 /* quick exit if rel is clearly empty */
774 if (curpages == 0)
775 {
776 *tuples = 0;
777 *allvisfrac = 0;
778 return;
779 }
780
781 /* estimate number of tuples from previous tuple density */
782 if (reltuples >= 0 && relpages > 0)
783 density = reltuples / (double) relpages;
784 else
785 {
786 /*
787 * When we have no data because the relation was never yet vacuumed,
788 * estimate tuple width from attribute datatypes. We assume here that
789 * the pages are completely full, which is OK for tables but is
790 * probably an overestimate for indexes. Fortunately
791 * get_relation_info() can clamp the overestimate to the parent
792 * table's size.
793 *
794 * Note: this code intentionally disregards alignment considerations,
795 * because (a) that would be gilding the lily considering how crude
796 * the estimate is, (b) it creates platform dependencies in the
797 * default plans which are kind of a headache for regression testing,
798 * and (c) different table AMs might use different padding schemes.
799 */
800 int32 tuple_width;
801 int fillfactor;
802
803 /*
804 * Without reltuples/relpages, we also need to consider fillfactor.
805 * The other branch considers it implicitly by calculating density
806 * from actual relpages/reltuples statistics.
807 */
809
810 tuple_width = get_rel_data_width(rel, attr_widths);
811 tuple_width += overhead_bytes_per_tuple;
812 /* note: integer division is intentional here */
813 density = (usable_bytes_per_page * fillfactor / 100) / tuple_width;
814 /* There's at least one row on the page, even with low fillfactor. */
815 density = clamp_row_est(density);
816 }
817 *tuples = rint(density * (double) curpages);
818
819 /*
820 * We use relallvisible as-is, rather than scaling it up like we do for
821 * the pages and tuples counts, on the theory that any pages added since
822 * the last VACUUM are most likely not marked all-visible. But costsize.c
823 * wants it converted to a fraction.
824 */
825 if (relallvisible == 0 || curpages <= 0)
826 *allvisfrac = 0;
827 else if ((double) relallvisible >= curpages)
828 *allvisfrac = 1;
829 else
830 *allvisfrac = (double) relallvisible / curpages;
831}
int32_t int32
Definition: c.h:537
double clamp_row_est(double nrows)
Definition: costsize.c:213
static int fillfactor
Definition: pgbench.c:188
int32 get_rel_data_width(Relation rel, int32 *attr_widths)
Definition: plancat.c:1391
#define RelationGetFillFactor(relation, defaultff)
Definition: rel.h:375
#define HEAP_DEFAULT_FILLFACTOR
Definition: rel.h:361
Form_pg_class rd_rel
Definition: rel.h:111

References clamp_row_est(), fillfactor, get_rel_data_width(), HEAP_DEFAULT_FILLFACTOR, if(), RelationData::rd_rel, RelationGetFillFactor, and RelationGetNumberOfBlocks.

Referenced by heapam_estimate_rel_size().

◆ table_block_relation_size()

uint64 table_block_relation_size ( Relation  rel,
ForkNumber  forkNumber 
)

Definition at line 687 of file tableam.c.

688{
689 uint64 nblocks = 0;
690
691 /* InvalidForkNumber indicates returning the size for all forks */
692 if (forkNumber == InvalidForkNumber)
693 {
694 for (int i = 0; i < MAX_FORKNUM; i++)
695 nblocks += smgrnblocks(RelationGetSmgr(rel), i);
696 }
697 else
698 nblocks = smgrnblocks(RelationGetSmgr(rel), forkNumber);
699
700 return nblocks * BLCKSZ;
701}
int i
Definition: isn.c:77
static SMgrRelation RelationGetSmgr(Relation rel)
Definition: rel.h:577
@ InvalidForkNumber
Definition: relpath.h:57
#define MAX_FORKNUM
Definition: relpath.h:70
BlockNumber smgrnblocks(SMgrRelation reln, ForkNumber forknum)
Definition: smgr.c:819

References i, InvalidForkNumber, MAX_FORKNUM, RelationGetSmgr(), and smgrnblocks().

◆ table_endscan()

◆ table_finish_bulk_insert()

static void table_finish_bulk_insert ( Relation  rel,
int  options 
)
inlinestatic

Definition at line 1574 of file tableam.h.

1575{
1576 /* optional callback */
1577 if (rel->rd_tableam && rel->rd_tableam->finish_bulk_insert)
1579}
void(* finish_bulk_insert)(Relation rel, int options)
Definition: tableam.h:577

References TableAmRoutine::finish_bulk_insert, and RelationData::rd_tableam.

Referenced by ATRewriteTable(), CopyMultiInsertBufferCleanup(), intorel_shutdown(), and transientrel_shutdown().

◆ table_index_build_range_scan()

static double table_index_build_range_scan ( Relation  table_rel,
Relation  index_rel,
IndexInfo index_info,
bool  allow_sync,
bool  anyvisible,
bool  progress,
BlockNumber  start_blockno,
BlockNumber  numblocks,
IndexBuildCallback  callback,
void *  callback_state,
TableScanDesc  scan 
)
inlinestatic

Definition at line 1787 of file tableam.h.

1798{
1799 return table_rel->rd_tableam->index_build_range_scan(table_rel,
1800 index_rel,
1801 index_info,
1802 allow_sync,
1803 anyvisible,
1804 progress,
1805 start_blockno,
1806 numblocks,
1807 callback,
1808 callback_state,
1809 scan);
1810}
static int progress
Definition: pgbench.c:262
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)
Definition: test_ifaddrs.c:46

References callback(), TableAmRoutine::index_build_range_scan, progress, and RelationData::rd_tableam.

Referenced by summarize_range().

◆ table_index_build_scan()

static double table_index_build_scan ( Relation  table_rel,
Relation  index_rel,
IndexInfo index_info,
bool  allow_sync,
bool  progress,
IndexBuildCallback  callback,
void *  callback_state,
TableScanDesc  scan 
)
inlinestatic

Definition at line 1754 of file tableam.h.

1762{
1763 return table_rel->rd_tableam->index_build_range_scan(table_rel,
1764 index_rel,
1765 index_info,
1766 allow_sync,
1767 false,
1768 progress,
1769 0,
1771 callback,
1772 callback_state,
1773 scan);
1774}

References callback(), TableAmRoutine::index_build_range_scan, InvalidBlockNumber, progress, and RelationData::rd_tableam.

Referenced by _brin_parallel_scan_and_build(), _bt_parallel_scan_and_sort(), _bt_spools_heapscan(), _gin_parallel_scan_and_build(), blbuild(), brinbuild(), bt_check_every_level(), ginbuild(), gistbuild(), hashbuild(), and spgbuild().

◆ table_index_delete_tuples()

static TransactionId table_index_delete_tuples ( Relation  rel,
TM_IndexDeleteOp delstate 
)
inlinestatic

Definition at line 1331 of file tableam.h.

1332{
1333 return rel->rd_tableam->index_delete_tuples(rel, delstate);
1334}

References TableAmRoutine::index_delete_tuples, and RelationData::rd_tableam.

Referenced by _bt_delitems_delete_check(), and index_compute_xid_horizon_for_tuples().

◆ table_index_fetch_begin()

static IndexFetchTableData * table_index_fetch_begin ( Relation  rel)
inlinestatic

◆ table_index_fetch_end()

static void table_index_fetch_end ( struct IndexFetchTableData scan)
inlinestatic

◆ table_index_fetch_reset()

static void table_index_fetch_reset ( struct IndexFetchTableData scan)
inlinestatic

◆ table_index_fetch_tuple()

static bool table_index_fetch_tuple ( struct IndexFetchTableData scan,
ItemPointer  tid,
Snapshot  snapshot,
TupleTableSlot slot,
bool *  call_again,
bool *  all_dead 
)
inlinestatic

Definition at line 1216 of file tableam.h.

1221{
1222 /*
1223 * We don't expect direct calls to table_index_fetch_tuple with valid
1224 * CheckXidAlive for catalog or regular tables. See detailed comments in
1225 * xact.c where these variables are declared.
1226 */
1228 elog(ERROR, "unexpected table_index_fetch_tuple call during logical decoding");
1229
1230 return scan->rel->rd_tableam->index_fetch_tuple(scan, tid, snapshot,
1231 slot, call_again,
1232 all_dead);
1233}
#define unlikely(x)
Definition: c.h:407
#define TransactionIdIsValid(xid)
Definition: transam.h:41
bool bsysscan
Definition: xact.c:101
TransactionId CheckXidAlive
Definition: xact.c:100

References bsysscan, CheckXidAlive, elog, ERROR, TableAmRoutine::index_fetch_tuple, RelationData::rd_tableam, IndexFetchTableData::rel, TransactionIdIsValid, and unlikely.

Referenced by index_fetch_heap(), and table_index_fetch_tuple_check().

◆ table_index_fetch_tuple_check()

bool table_index_fetch_tuple_check ( Relation  rel,
ItemPointer  tid,
Snapshot  snapshot,
bool *  all_dead 
)

Definition at line 240 of file tableam.c.

244{
246 TupleTableSlot *slot;
247 bool call_again = false;
248 bool found;
249
250 slot = table_slot_create(rel, NULL);
251 scan = table_index_fetch_begin(rel);
252 found = table_index_fetch_tuple(scan, tid, snapshot, slot, &call_again,
253 all_dead);
256
257 return found;
258}
void ExecDropSingleTupleTableSlot(TupleTableSlot *slot)
Definition: execTuples.c:1443
TupleTableSlot * table_slot_create(Relation relation, List **reglist)
Definition: tableam.c:92
static IndexFetchTableData * table_index_fetch_begin(Relation rel)
Definition: tableam.h:1167
static void table_index_fetch_end(struct IndexFetchTableData *scan)
Definition: tableam.h:1186
static bool table_index_fetch_tuple(struct IndexFetchTableData *scan, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot, bool *call_again, bool *all_dead)
Definition: tableam.h:1216

References ExecDropSingleTupleTableSlot(), table_index_fetch_begin(), table_index_fetch_end(), table_index_fetch_tuple(), and table_slot_create().

Referenced by _bt_check_unique().

◆ table_index_validate_scan()

static void table_index_validate_scan ( Relation  table_rel,
Relation  index_rel,
IndexInfo index_info,
Snapshot  snapshot,
ValidateIndexState state 
)
inlinestatic

Definition at line 1818 of file tableam.h.

1823{
1824 table_rel->rd_tableam->index_validate_scan(table_rel,
1825 index_rel,
1826 index_info,
1827 snapshot,
1828 state);
1829}
Definition: regguts.h:323

References TableAmRoutine::index_validate_scan, and RelationData::rd_tableam.

Referenced by validate_index().

◆ table_multi_insert()

static void table_multi_insert ( Relation  rel,
TupleTableSlot **  slots,
int  nslots,
CommandId  cid,
int  options,
BulkInsertStateData bistate 
)
inlinestatic

Definition at line 1432 of file tableam.h.

1434{
1435 rel->rd_tableam->multi_insert(rel, slots, nslots,
1436 cid, options, bistate);
1437}

References TableAmRoutine::multi_insert, and RelationData::rd_tableam.

Referenced by CopyMultiInsertBufferFlush().

◆ table_parallelscan_estimate()

Size table_parallelscan_estimate ( Relation  rel,
Snapshot  snapshot 
)

Definition at line 131 of file tableam.c.

132{
133 Size sz = 0;
134
135 if (IsMVCCSnapshot(snapshot))
136 sz = add_size(sz, EstimateSnapshotSpace(snapshot));
137 else
138 Assert(snapshot == SnapshotAny);
139
140 sz = add_size(sz, rel->rd_tableam->parallelscan_estimate(rel));
141
142 return sz;
143}
size_t Size
Definition: c.h:613
Size add_size(Size s1, Size s2)
Definition: shmem.c:495
Size EstimateSnapshotSpace(Snapshot snapshot)
Definition: snapmgr.c:1712
#define IsMVCCSnapshot(snapshot)
Definition: snapmgr.h:55

References add_size(), Assert(), EstimateSnapshotSpace(), IsMVCCSnapshot, TableAmRoutine::parallelscan_estimate, RelationData::rd_tableam, and SnapshotAny.

Referenced by _brin_parallel_estimate_shared(), _bt_parallel_estimate_shared(), _gin_parallel_estimate_shared(), ExecSeqScanEstimate(), and ExecTidRangeScanEstimate().

◆ table_parallelscan_initialize()

void table_parallelscan_initialize ( Relation  rel,
ParallelTableScanDesc  pscan,
Snapshot  snapshot 
)

Definition at line 146 of file tableam.c.

148{
149 Size snapshot_off = rel->rd_tableam->parallelscan_initialize(rel, pscan);
150
151 pscan->phs_snapshot_off = snapshot_off;
152
153 if (IsMVCCSnapshot(snapshot))
154 {
155 SerializeSnapshot(snapshot, (char *) pscan + pscan->phs_snapshot_off);
156 pscan->phs_snapshot_any = false;
157 }
158 else
159 {
160 Assert(snapshot == SnapshotAny);
161 pscan->phs_snapshot_any = true;
162 }
163}
void SerializeSnapshot(Snapshot snapshot, char *start_address)
Definition: snapmgr.c:1736

References Assert(), IsMVCCSnapshot, TableAmRoutine::parallelscan_initialize, ParallelTableScanDescData::phs_snapshot_any, ParallelTableScanDescData::phs_snapshot_off, RelationData::rd_tableam, SerializeSnapshot(), and SnapshotAny.

Referenced by _brin_begin_parallel(), _bt_begin_parallel(), _gin_begin_parallel(), ExecSeqScanInitializeDSM(), and ExecTidRangeScanInitializeDSM().

◆ table_parallelscan_reinitialize()

static void table_parallelscan_reinitialize ( Relation  rel,
ParallelTableScanDesc  pscan 
)
inlinestatic

◆ table_relation_copy_data()

static void table_relation_copy_data ( Relation  rel,
const RelFileLocator newrlocator 
)
inlinestatic

Definition at line 1630 of file tableam.h.

1631{
1632 rel->rd_tableam->relation_copy_data(rel, newrlocator);
1633}

References RelationData::rd_tableam, and TableAmRoutine::relation_copy_data.

Referenced by ATExecSetTableSpace().

◆ table_relation_copy_for_cluster()

static void table_relation_copy_for_cluster ( Relation  OldTable,
Relation  NewTable,
Relation  OldIndex,
bool  use_sort,
TransactionId  OldestXmin,
TransactionId xid_cutoff,
MultiXactId multi_cutoff,
double *  num_tuples,
double *  tups_vacuumed,
double *  tups_recently_dead 
)
inlinestatic

Definition at line 1657 of file tableam.h.

1666{
1667 OldTable->rd_tableam->relation_copy_for_cluster(OldTable, NewTable, OldIndex,
1668 use_sort, OldestXmin,
1669 xid_cutoff, multi_cutoff,
1670 num_tuples, tups_vacuumed,
1671 tups_recently_dead);
1672}

References RelationData::rd_tableam, and TableAmRoutine::relation_copy_for_cluster.

Referenced by copy_table_data().

◆ table_relation_estimate_size()

static void table_relation_estimate_size ( Relation  rel,
int32 attr_widths,
BlockNumber pages,
double *  tuples,
double *  allvisfrac 
)
inlinestatic

Definition at line 1916 of file tableam.h.

1919{
1920 rel->rd_tableam->relation_estimate_size(rel, attr_widths, pages, tuples,
1921 allvisfrac);
1922}

References RelationData::rd_tableam, and TableAmRoutine::relation_estimate_size.

Referenced by estimate_rel_size().

◆ table_relation_fetch_toast_slice()

static void table_relation_fetch_toast_slice ( Relation  toastrel,
Oid  valueid,
int32  attrsize,
int32  sliceoffset,
int32  slicelength,
struct varlena result 
)
inlinestatic

Definition at line 1895 of file tableam.h.

1898{
1899 toastrel->rd_tableam->relation_fetch_toast_slice(toastrel, valueid,
1900 attrsize,
1901 sliceoffset, slicelength,
1902 result);
1903}
void(* relation_fetch_toast_slice)(Relation toastrel, Oid valueid, int32 attrsize, int32 sliceoffset, int32 slicelength, struct varlena *result)
Definition: tableam.h:749

References RelationData::rd_tableam, and TableAmRoutine::relation_fetch_toast_slice.

Referenced by toast_fetch_datum(), and toast_fetch_datum_slice().

◆ table_relation_needs_toast_table()

static bool table_relation_needs_toast_table ( Relation  rel)
inlinestatic

Definition at line 1856 of file tableam.h.

1857{
1858 return rel->rd_tableam->relation_needs_toast_table(rel);
1859}

References RelationData::rd_tableam, and TableAmRoutine::relation_needs_toast_table.

Referenced by needs_toast_table().

◆ table_relation_nontransactional_truncate()

static void table_relation_nontransactional_truncate ( Relation  rel)
inlinestatic

◆ table_relation_set_new_filelocator()

static void table_relation_set_new_filelocator ( Relation  rel,
const RelFileLocator newrlocator,
char  persistence,
TransactionId freezeXid,
MultiXactId minmulti 
)
inlinestatic

Definition at line 1600 of file tableam.h.

1605{
1606 rel->rd_tableam->relation_set_new_filelocator(rel, newrlocator,
1607 persistence, freezeXid,
1608 minmulti);
1609}

References RelationData::rd_tableam, and TableAmRoutine::relation_set_new_filelocator.

Referenced by heap_create(), and RelationSetNewRelfilenumber().

◆ table_relation_size()

static uint64 table_relation_size ( Relation  rel,
ForkNumber  forkNumber 
)
inlinestatic

Definition at line 1847 of file tableam.h.

1848{
1849 return rel->rd_tableam->relation_size(rel, forkNumber);
1850}

References RelationData::rd_tableam, and TableAmRoutine::relation_size.

Referenced by RelationGetNumberOfBlocksInFork().

◆ table_relation_toast_am()

static Oid table_relation_toast_am ( Relation  rel)
inlinestatic

Definition at line 1866 of file tableam.h.

1867{
1868 return rel->rd_tableam->relation_toast_am(rel);
1869}
Oid(* relation_toast_am)(Relation rel)
Definition: tableam.h:742

References RelationData::rd_tableam, and TableAmRoutine::relation_toast_am.

Referenced by create_toast_table().

◆ table_relation_vacuum()

static void table_relation_vacuum ( Relation  rel,
const VacuumParams  params,
BufferAccessStrategy  bstrategy 
)
inlinestatic

Definition at line 1686 of file tableam.h.

1688{
1689 rel->rd_tableam->relation_vacuum(rel, params, bstrategy);
1690}

References RelationData::rd_tableam, and TableAmRoutine::relation_vacuum.

Referenced by vacuum_rel().

◆ table_rescan()

static void table_rescan ( TableScanDesc  scan,
ScanKeyData key 
)
inlinestatic

◆ table_rescan_set_params()

static void table_rescan_set_params ( TableScanDesc  scan,
ScanKeyData key,
bool  allow_strat,
bool  allow_sync,
bool  allow_pagemode 
)
inlinestatic

Definition at line 1008 of file tableam.h.

1010{
1011 scan->rs_rd->rd_tableam->scan_rescan(scan, key, true,
1012 allow_strat, allow_sync,
1013 allow_pagemode);
1014}

References sort-test::key, RelationData::rd_tableam, TableScanDescData::rs_rd, and TableAmRoutine::scan_rescan.

Referenced by tablesample_init().

◆ table_rescan_tidrange()

static void table_rescan_tidrange ( TableScanDesc  sscan,
ItemPointer  mintid,
ItemPointer  maxtid 
)
inlinestatic

Definition at line 1070 of file tableam.h.

1072{
1073 /* Ensure table_beginscan_tidrange() was used. */
1074 Assert((sscan->rs_flags & SO_TYPE_TIDRANGESCAN) != 0);
1075
1076 sscan->rs_rd->rd_tableam->scan_rescan(sscan, NULL, false, false, false, false);
1077 sscan->rs_rd->rd_tableam->scan_set_tidrange(sscan, mintid, maxtid);
1078}
uint32 rs_flags
Definition: relscan.h:64

References Assert(), RelationData::rd_tableam, TableScanDescData::rs_flags, TableScanDescData::rs_rd, TableAmRoutine::scan_rescan, TableAmRoutine::scan_set_tidrange, and SO_TYPE_TIDRANGESCAN.

Referenced by TidRangeNext().

◆ table_scan_analyze_next_block()

static bool table_scan_analyze_next_block ( TableScanDesc  scan,
ReadStream stream 
)
inlinestatic

Definition at line 1701 of file tableam.h.

1702{
1703 return scan->rs_rd->rd_tableam->scan_analyze_next_block(scan, stream);
1704}

References RelationData::rd_tableam, TableScanDescData::rs_rd, and TableAmRoutine::scan_analyze_next_block.

Referenced by acquire_sample_rows().

◆ table_scan_analyze_next_tuple()

static bool table_scan_analyze_next_tuple ( TableScanDesc  scan,
TransactionId  OldestXmin,
double *  liverows,
double *  deadrows,
TupleTableSlot slot 
)
inlinestatic

Definition at line 1717 of file tableam.h.

1720{
1721 return scan->rs_rd->rd_tableam->scan_analyze_next_tuple(scan, OldestXmin,
1722 liverows, deadrows,
1723 slot);
1724}

References RelationData::rd_tableam, TableScanDescData::rs_rd, and TableAmRoutine::scan_analyze_next_tuple.

Referenced by acquire_sample_rows().

◆ table_scan_bitmap_next_tuple()

static bool table_scan_bitmap_next_tuple ( TableScanDesc  scan,
TupleTableSlot slot,
bool *  recheck,
uint64 lossy_pages,
uint64 exact_pages 
)
inlinestatic

Definition at line 1944 of file tableam.h.

1949{
1950 /*
1951 * We don't expect direct calls to table_scan_bitmap_next_tuple with valid
1952 * CheckXidAlive for catalog or regular tables. See detailed comments in
1953 * xact.c where these variables are declared.
1954 */
1956 elog(ERROR, "unexpected table_scan_bitmap_next_tuple call during logical decoding");
1957
1958 return scan->rs_rd->rd_tableam->scan_bitmap_next_tuple(scan,
1959 slot,
1960 recheck,
1961 lossy_pages,
1962 exact_pages);
1963}
bool(* scan_bitmap_next_tuple)(TableScanDesc scan, TupleTableSlot *slot, bool *recheck, uint64 *lossy_pages, uint64 *exact_pages)
Definition: tableam.h:793

References bsysscan, CheckXidAlive, elog, ERROR, RelationData::rd_tableam, TableScanDescData::rs_rd, TableAmRoutine::scan_bitmap_next_tuple, TransactionIdIsValid, and unlikely.

Referenced by BitmapHeapNext().

◆ table_scan_getnextslot()

static bool table_scan_getnextslot ( TableScanDesc  sscan,
ScanDirection  direction,
TupleTableSlot slot 
)
inlinestatic

Definition at line 1020 of file tableam.h.

1021{
1022 slot->tts_tableOid = RelationGetRelid(sscan->rs_rd);
1023
1024 /* We don't expect actual scans using NoMovementScanDirection */
1025 Assert(direction == ForwardScanDirection ||
1026 direction == BackwardScanDirection);
1027
1028 /*
1029 * We don't expect direct calls to table_scan_getnextslot with valid
1030 * CheckXidAlive for catalog or regular tables. See detailed comments in
1031 * xact.c where these variables are declared.
1032 */
1034 elog(ERROR, "unexpected table_scan_getnextslot call during logical decoding");
1035
1036 return sscan->rs_rd->rd_tableam->scan_getnextslot(sscan, direction, slot);
1037}
@ BackwardScanDirection
Definition: sdir.h:26
@ ForwardScanDirection
Definition: sdir.h:28
Oid tts_tableOid
Definition: tuptable.h:129

References Assert(), BackwardScanDirection, bsysscan, CheckXidAlive, elog, ERROR, ForwardScanDirection, RelationData::rd_tableam, RelationGetRelid, TableScanDescData::rs_rd, TableAmRoutine::scan_getnextslot, TransactionIdIsValid, TupleTableSlot::tts_tableOid, and unlikely.

Referenced by ATRewriteTable(), check_default_partition_contents(), CopyRelationTo(), heapam_relation_copy_for_cluster(), IndexCheckExclusion(), RelationFindDeletedTupleInfoSeq(), RelationFindReplTupleSeq(), SeqNext(), systable_getnext(), validateDomainCheckConstraint(), validateDomainNotNullConstraint(), and validateForeignKeyConstraint().

◆ table_scan_getnextslot_tidrange()

static bool table_scan_getnextslot_tidrange ( TableScanDesc  sscan,
ScanDirection  direction,
TupleTableSlot slot 
)
inlinestatic

Definition at line 1086 of file tableam.h.

1088{
1089 /* Ensure table_beginscan_tidrange() was used. */
1090 Assert((sscan->rs_flags & SO_TYPE_TIDRANGESCAN) != 0);
1091
1092 /* We don't expect actual scans using NoMovementScanDirection */
1093 Assert(direction == ForwardScanDirection ||
1094 direction == BackwardScanDirection);
1095
1096 return sscan->rs_rd->rd_tableam->scan_getnextslot_tidrange(sscan,
1097 direction,
1098 slot);
1099}
bool(* scan_getnextslot_tidrange)(TableScanDesc scan, ScanDirection direction, TupleTableSlot *slot)
Definition: tableam.h:379

References Assert(), BackwardScanDirection, ForwardScanDirection, RelationData::rd_tableam, TableScanDescData::rs_flags, TableScanDescData::rs_rd, TableAmRoutine::scan_getnextslot_tidrange, and SO_TYPE_TIDRANGESCAN.

Referenced by TidRangeNext().

◆ table_scan_sample_next_block()

static bool table_scan_sample_next_block ( TableScanDesc  scan,
SampleScanState scanstate 
)
inlinestatic

Definition at line 1975 of file tableam.h.

1977{
1978 /*
1979 * We don't expect direct calls to table_scan_sample_next_block with valid
1980 * CheckXidAlive for catalog or regular tables. See detailed comments in
1981 * xact.c where these variables are declared.
1982 */
1984 elog(ERROR, "unexpected table_scan_sample_next_block call during logical decoding");
1985 return scan->rs_rd->rd_tableam->scan_sample_next_block(scan, scanstate);
1986}

References bsysscan, CheckXidAlive, elog, ERROR, RelationData::rd_tableam, TableScanDescData::rs_rd, TableAmRoutine::scan_sample_next_block, TransactionIdIsValid, and unlikely.

Referenced by tablesample_getnext().

◆ table_scan_sample_next_tuple()

static bool table_scan_sample_next_tuple ( TableScanDesc  scan,
SampleScanState scanstate,
TupleTableSlot slot 
)
inlinestatic

Definition at line 1997 of file tableam.h.

2000{
2001 /*
2002 * We don't expect direct calls to table_scan_sample_next_tuple with valid
2003 * CheckXidAlive for catalog or regular tables. See detailed comments in
2004 * xact.c where these variables are declared.
2005 */
2007 elog(ERROR, "unexpected table_scan_sample_next_tuple call during logical decoding");
2008 return scan->rs_rd->rd_tableam->scan_sample_next_tuple(scan, scanstate,
2009 slot);
2010}

References bsysscan, CheckXidAlive, elog, ERROR, RelationData::rd_tableam, TableScanDescData::rs_rd, TableAmRoutine::scan_sample_next_tuple, TransactionIdIsValid, and unlikely.

Referenced by tablesample_getnext().

◆ table_slot_callbacks()

const TupleTableSlotOps * table_slot_callbacks ( Relation  relation)

Definition at line 59 of file tableam.c.

60{
61 const TupleTableSlotOps *tts_cb;
62
63 if (relation->rd_tableam)
64 tts_cb = relation->rd_tableam->slot_callbacks(relation);
65 else if (relation->rd_rel->relkind == RELKIND_FOREIGN_TABLE)
66 {
67 /*
68 * Historically FDWs expect to store heap tuples in slots. Continue
69 * handing them one, to make it less painful to adapt FDWs to new
70 * versions. The cost of a heap slot over a virtual slot is pretty
71 * small.
72 */
73 tts_cb = &TTSOpsHeapTuple;
74 }
75 else
76 {
77 /*
78 * These need to be supported, as some parts of the code (like COPY)
79 * need to create slots for such relations too. It seems better to
80 * centralize the knowledge that a heap slot is the right thing in
81 * that case here.
82 */
83 Assert(relation->rd_rel->relkind == RELKIND_VIEW ||
84 relation->rd_rel->relkind == RELKIND_PARTITIONED_TABLE);
85 tts_cb = &TTSOpsVirtual;
86 }
87
88 return tts_cb;
89}
const TupleTableSlotOps TTSOpsVirtual
Definition: execTuples.c:84
const TupleTableSlotOps TTSOpsHeapTuple
Definition: execTuples.c:85
const TupleTableSlotOps *(* slot_callbacks)(Relation rel)
Definition: tableam.h:303

References Assert(), RelationData::rd_rel, RelationData::rd_tableam, TableAmRoutine::slot_callbacks, TTSOpsHeapTuple, and TTSOpsVirtual.

Referenced by ATRewriteTable(), ExecGetAllNullSlot(), ExecGetReturningSlot(), ExecGetTriggerNewSlot(), ExecGetTriggerOldSlot(), ExecInitBitmapHeapScan(), ExecInitIndexOnlyScan(), ExecInitIndexScan(), ExecInitSampleScan(), ExecInitSeqScan(), ExecInitTidRangeScan(), ExecInitTidScan(), and table_slot_create().

◆ table_slot_create()

TupleTableSlot * table_slot_create ( Relation  relation,
List **  reglist 
)

Definition at line 92 of file tableam.c.

93{
94 const TupleTableSlotOps *tts_cb;
95 TupleTableSlot *slot;
96
97 tts_cb = table_slot_callbacks(relation);
98 slot = MakeSingleTupleTableSlot(RelationGetDescr(relation), tts_cb);
99
100 if (reglist)
101 *reglist = lappend(*reglist, slot);
102
103 return slot;
104}
TupleTableSlot * MakeSingleTupleTableSlot(TupleDesc tupdesc, const TupleTableSlotOps *tts_ops)
Definition: execTuples.c:1427
List * lappend(List *list, void *datum)
Definition: list.c:339
#define RelationGetDescr(relation)
Definition: rel.h:541
const TupleTableSlotOps * table_slot_callbacks(Relation relation)
Definition: tableam.c:59

References lappend(), MakeSingleTupleTableSlot(), RelationGetDescr, and table_slot_callbacks().

Referenced by acquire_sample_rows(), apply_handle_tuple_routing(), apply_handle_update_internal(), build_index_value_desc(), check_default_partition_contents(), check_exclusion_or_unique_constraint(), CopyFrom(), CopyMultiInsertInfoNextFreeSlot(), CopyRelationTo(), EvalPlanQualSlot(), ExecCrossPartitionUpdate(), ExecInitInsertProjection(), ExecInitMerge(), ExecInitMergeTupleSlots(), ExecInitModifyTable(), ExecInitPartitionInfo(), ExecInitRoutingInfo(), ExecInitUpdateProjection(), FindConflictTuple(), FindReplTupleInLocalRel(), get_actual_variable_range(), heap_entry_is_visible(), heapam_index_build_range_scan(), heapam_relation_copy_for_cluster(), IndexCheckExclusion(), RelationFindDeletedTupleInfoByIndex(), RelationFindDeletedTupleInfoSeq(), RelationFindReplTupleSeq(), systable_beginscan(), systable_beginscan_ordered(), table_index_fetch_tuple_check(), validateDomainCheckConstraint(), validateDomainNotNullConstraint(), and validateForeignKeyConstraint().

◆ table_tuple_complete_speculative()

static void table_tuple_complete_speculative ( Relation  rel,
TupleTableSlot slot,
uint32  specToken,
bool  succeeded 
)
inlinestatic

Definition at line 1410 of file tableam.h.

1412{
1413 rel->rd_tableam->tuple_complete_speculative(rel, slot, specToken,
1414 succeeded);
1415}

References RelationData::rd_tableam, and TableAmRoutine::tuple_complete_speculative.

Referenced by ExecInsert().

◆ table_tuple_delete()

static TM_Result table_tuple_delete ( Relation  rel,
ItemPointer  tid,
CommandId  cid,
Snapshot  snapshot,
Snapshot  crosscheck,
bool  wait,
TM_FailureData tmfd,
bool  changingPart 
)
inlinestatic

Definition at line 1467 of file tableam.h.

1470{
1471 return rel->rd_tableam->tuple_delete(rel, tid, cid,
1472 snapshot, crosscheck,
1473 wait, tmfd, changingPart);
1474}

References RelationData::rd_tableam, and TableAmRoutine::tuple_delete.

Referenced by ExecDeleteAct(), and simple_table_tuple_delete().

◆ table_tuple_fetch_row_version()

static bool table_tuple_fetch_row_version ( Relation  rel,
ItemPointer  tid,
Snapshot  snapshot,
TupleTableSlot slot 
)
inlinestatic

Definition at line 1263 of file tableam.h.

1267{
1268 /*
1269 * We don't expect direct calls to table_tuple_fetch_row_version with
1270 * valid CheckXidAlive for catalog or regular tables. See detailed
1271 * comments in xact.c where these variables are declared.
1272 */
1274 elog(ERROR, "unexpected table_tuple_fetch_row_version call during logical decoding");
1275
1276 return rel->rd_tableam->tuple_fetch_row_version(rel, tid, snapshot, slot);
1277}

References bsysscan, CheckXidAlive, elog, ERROR, RelationData::rd_tableam, TransactionIdIsValid, TableAmRoutine::tuple_fetch_row_version, and unlikely.

Referenced by AfterTriggerExecute(), EvalPlanQualFetchRowMark(), ExecCheckTIDVisible(), ExecCrossPartitionUpdate(), ExecDelete(), ExecMergeMatched(), ExecModifyTable(), ExecUpdate(), GetTupleForTrigger(), heap_entry_is_visible(), and TidNext().

◆ table_tuple_get_latest_tid()

void table_tuple_get_latest_tid ( TableScanDesc  scan,
ItemPointer  tid 
)

Definition at line 267 of file tableam.c.

268{
269 Relation rel = scan->rs_rd;
270 const TableAmRoutine *tableam = rel->rd_tableam;
271
272 /*
273 * We don't expect direct calls to table_tuple_get_latest_tid with valid
274 * CheckXidAlive for catalog or regular tables. See detailed comments in
275 * xact.c where these variables are declared.
276 */
278 elog(ERROR, "unexpected table_tuple_get_latest_tid call during logical decoding");
279
280 /*
281 * Since this can be called with user-supplied TID, don't trust the input
282 * too much.
283 */
284 if (!tableam->tuple_tid_valid(scan, tid))
286 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
287 errmsg("tid (%u, %u) is not valid for relation \"%s\"",
291
292 tableam->tuple_get_latest_tid(scan, tid);
293}
int errcode(int sqlerrcode)
Definition: elog.c:863
int errmsg(const char *fmt,...)
Definition: elog.c:1080
#define ereport(elevel,...)
Definition: elog.h:150
static OffsetNumber ItemPointerGetOffsetNumberNoCheck(const ItemPointerData *pointer)
Definition: itemptr.h:114
static BlockNumber ItemPointerGetBlockNumberNoCheck(const ItemPointerData *pointer)
Definition: itemptr.h:93
#define RelationGetRelationName(relation)
Definition: rel.h:549

References bsysscan, CheckXidAlive, elog, ereport, errcode(), errmsg(), ERROR, ItemPointerGetBlockNumberNoCheck(), ItemPointerGetOffsetNumberNoCheck(), RelationData::rd_tableam, RelationGetRelationName, TableScanDescData::rs_rd, TransactionIdIsValid, TableAmRoutine::tuple_get_latest_tid, TableAmRoutine::tuple_tid_valid, and unlikely.

Referenced by currtid_internal(), and TidNext().

◆ table_tuple_insert()

static void table_tuple_insert ( Relation  rel,
TupleTableSlot slot,
CommandId  cid,
int  options,
BulkInsertStateData bistate 
)
inlinestatic

Definition at line 1377 of file tableam.h.

1379{
1380 rel->rd_tableam->tuple_insert(rel, slot, cid, options,
1381 bistate);
1382}

References RelationData::rd_tableam, and TableAmRoutine::tuple_insert.

Referenced by ATRewriteTable(), CopyFrom(), ExecInsert(), intorel_receive(), simple_table_tuple_insert(), and transientrel_receive().

◆ table_tuple_insert_speculative()

static void table_tuple_insert_speculative ( Relation  rel,
TupleTableSlot slot,
CommandId  cid,
int  options,
BulkInsertStateData bistate,
uint32  specToken 
)
inlinestatic

Definition at line 1396 of file tableam.h.

1400{
1401 rel->rd_tableam->tuple_insert_speculative(rel, slot, cid, options,
1402 bistate, specToken);
1403}

References RelationData::rd_tableam, and TableAmRoutine::tuple_insert_speculative.

Referenced by ExecInsert().

◆ table_tuple_lock()

static TM_Result table_tuple_lock ( Relation  rel,
ItemPointer  tid,
Snapshot  snapshot,
TupleTableSlot slot,
CommandId  cid,
LockTupleMode  mode,
LockWaitPolicy  wait_policy,
uint8  flags,
TM_FailureData tmfd 
)
inlinestatic

Definition at line 1559 of file tableam.h.

1563{
1564 return rel->rd_tableam->tuple_lock(rel, tid, snapshot, slot,
1565 cid, mode, wait_policy,
1566 flags, tmfd);
1567}
static PgChecksumMode mode
Definition: pg_checksums.c:56

References mode, RelationData::rd_tableam, and TableAmRoutine::tuple_lock.

Referenced by ExecDelete(), ExecLockRows(), ExecMergeMatched(), ExecOnConflictUpdate(), ExecUpdate(), FindConflictTuple(), GetTupleForTrigger(), RelationFindReplTupleByIndex(), and RelationFindReplTupleSeq().

◆ table_tuple_satisfies_snapshot()

static bool table_tuple_satisfies_snapshot ( Relation  rel,
TupleTableSlot slot,
Snapshot  snapshot 
)
inlinestatic

Definition at line 1310 of file tableam.h.

1312{
1313 return rel->rd_tableam->tuple_satisfies_snapshot(rel, slot, snapshot);
1314}

References RelationData::rd_tableam, and TableAmRoutine::tuple_satisfies_snapshot.

Referenced by ExecCheckTupleVisible(), RI_FKey_check(), and systable_recheck_tuple().

◆ table_tuple_tid_valid()

static bool table_tuple_tid_valid ( TableScanDesc  scan,
ItemPointer  tid 
)
inlinestatic

Definition at line 1289 of file tableam.h.

1290{
1291 return scan->rs_rd->rd_tableam->tuple_tid_valid(scan, tid);
1292}

References RelationData::rd_tableam, TableScanDescData::rs_rd, and TableAmRoutine::tuple_tid_valid.

Referenced by TidListEval().

◆ table_tuple_update()

static TM_Result table_tuple_update ( Relation  rel,
ItemPointer  otid,
TupleTableSlot slot,
CommandId  cid,
Snapshot  snapshot,
Snapshot  crosscheck,
bool  wait,
TM_FailureData tmfd,
LockTupleMode lockmode,
TU_UpdateIndexes update_indexes 
)
inlinestatic

Definition at line 1512 of file tableam.h.

1516{
1517 return rel->rd_tableam->tuple_update(rel, otid, slot,
1518 cid, snapshot, crosscheck,
1519 wait, tmfd,
1520 lockmode, update_indexes);
1521}

References RelationData::rd_tableam, and TableAmRoutine::tuple_update.

Referenced by ExecUpdateAct(), and simple_table_tuple_update().

Variable Documentation

◆ default_table_access_method

PGDLLIMPORT char* default_table_access_method
extern

Definition at line 49 of file tableam.c.

Referenced by ATPrepSetAccessMethod(), and DefineRelation().

◆ synchronize_seqscans

PGDLLIMPORT bool synchronize_seqscans
extern

Definition at line 50 of file tableam.c.

Referenced by initscan(), and table_block_parallelscan_initialize().