PostgreSQL Source Code: src/include/access/heapam.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef HEAPAM_H
15#define HEAPAM_H
16
22#include "access/table.h"
33
34
35
36#define HEAP_INSERT_SKIP_FSM TABLE_INSERT_SKIP_FSM
37#define HEAP_INSERT_FROZEN TABLE_INSERT_FROZEN
38#define HEAP_INSERT_NO_LOGICAL TABLE_INSERT_NO_LOGICAL
39#define HEAP_INSERT_SPECULATIVE 0x0010
40
41
42#define HEAP_PAGE_PRUNE_MARK_UNUSED_NOW (1 << 0)
43#define HEAP_PAGE_PRUNE_FREEZE (1 << 1)
44
48
49#define MaxLockTupleMode LockTupleExclusive
50
51
52
53
55{
57
58
62
63
64
69
70
72
74
75
77
78
79
80
81
82
83
84
85
88
89
90
91
92
94
95
101
103{
105
106
109
110
111
112
114{
116
118
120
121
122typedef enum
123{
130
131
132
133
134
135#define HEAP_FREEZE_CHECK_XMIN_COMMITTED 0x01
136#define HEAP_FREEZE_CHECK_XMAX_ABORTED 0x02
137
138
140{
141
146
147
149
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
178{
179
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
208
209
210
211
212
213
214
215
216
219
221
222
223
224
226{
228 int nnewlpdead;
230
231
234
235
236
237
238
239
240
241
242
243
244
245
249
250
251
252
253
254
256
257
258
259
260
264
265
266typedef enum
267{
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286#define HeapScanIsValid(scan) PointerIsValid(scan)
287
296 bool allow_strat, bool allow_sync, bool allow_pagemode);
310 bool *all_dead, bool first_call);
311
313
317
335 bool follow_updates,
337
340 void (*release_callback) (void *), void *arg);
350
363
368
371
372
391 bool cleanup_lock,
397
398
402
403
417
418
419
420
421
430
431
432
433
434
435
436
437
438
439
440static inline void
442{
444
447
450
453}
454
455#endif
TransactionId MultiXactId
void heap_finish_speculative(Relation relation, ItemPointer tid)
void heap_insert(Relation relation, HeapTuple tup, CommandId cid, int options, BulkInsertState bistate)
struct HeapTupleFreeze HeapTupleFreeze
struct PruneFreezeResult PruneFreezeResult
bool heap_inplace_lock(Relation relation, HeapTuple oldtup_ptr, Buffer buffer, void(*release_callback)(void *), void *arg)
void heap_page_prune_and_freeze(Relation relation, Buffer buffer, struct GlobalVisState *vistest, int options, struct VacuumCutoffs *cutoffs, PruneFreezeResult *presult, PruneReason reason, OffsetNumber *off_loc, TransactionId *new_relfrozen_xid, MultiXactId *new_relmin_mxid)
bool heap_fetch(Relation relation, Snapshot snapshot, HeapTuple tuple, Buffer *userbuf, bool keep_buf)
void HeapTupleSetHintBits(HeapTupleHeader tuple, Buffer buffer, uint16 infomask, TransactionId xid)
bool HeapTupleSatisfiesVisibility(HeapTuple htup, Snapshot snapshot, Buffer buffer)
HTSV_Result HeapTupleSatisfiesVacuumHorizon(HeapTuple htup, Buffer buffer, TransactionId *dead_after)
struct HeapScanDescData * HeapScanDesc
bool HeapTupleIsSurelyDead(HeapTuple htup, struct GlobalVisState *vistest)
void simple_heap_delete(Relation relation, ItemPointer tid)
void heap_get_root_tuples(Page page, OffsetNumber *root_offsets)
void heap_vacuum_rel(Relation rel, struct VacuumParams *params, BufferAccessStrategy bstrategy)
void heap_page_prune_opt(Relation relation, Buffer buffer)
@ HEAPTUPLE_RECENTLY_DEAD
@ HEAPTUPLE_INSERT_IN_PROGRESS
@ HEAPTUPLE_DELETE_IN_PROGRESS
void heap_endscan(TableScanDesc sscan)
void heap_rescan(TableScanDesc sscan, ScanKey key, bool set_params, bool allow_strat, bool allow_sync, bool allow_pagemode)
void heap_inplace_unlock(Relation relation, HeapTuple oldtup, Buffer buffer)
struct BitmapHeapScanDescData * BitmapHeapScanDesc
bool heap_tuple_needs_eventual_freeze(HeapTupleHeader tuple)
bool ResolveCminCmaxDuringDecoding(struct HTAB *tuplecid_data, Snapshot snapshot, HeapTuple htup, Buffer buffer, CommandId *cmin, CommandId *cmax)
TM_Result heap_delete(Relation relation, ItemPointer tid, CommandId cid, Snapshot crosscheck, bool wait, struct TM_FailureData *tmfd, bool changingPart)
bool heap_tuple_should_freeze(HeapTupleHeader tuple, const struct VacuumCutoffs *cutoffs, TransactionId *NoFreezePageRelfrozenXid, MultiXactId *NoFreezePageRelminMxid)
bool heap_freeze_tuple(HeapTupleHeader tuple, TransactionId relfrozenxid, TransactionId relminmxid, TransactionId FreezeLimit, TransactionId MultiXactCutoff)
void heap_inplace_update_and_unlock(Relation relation, HeapTuple oldtup, HeapTuple tuple, Buffer buffer)
struct HeapPageFreeze HeapPageFreeze
void ReleaseBulkInsertStatePin(BulkInsertState bistate)
void log_heap_prune_and_freeze(Relation relation, Buffer buffer, TransactionId conflict_xid, bool cleanup_lock, PruneReason reason, HeapTupleFreeze *frozen, int nfrozen, OffsetNumber *redirected, int nredirected, OffsetNumber *dead, int ndead, OffsetNumber *unused, int nunused)
void heap_multi_insert(Relation relation, struct TupleTableSlot **slots, int ntuples, CommandId cid, int options, BulkInsertState bistate)
HeapTuple heap_getnext(TableScanDesc sscan, ScanDirection direction)
bool heap_hot_search_buffer(ItemPointer tid, Relation relation, Buffer buffer, Snapshot snapshot, HeapTuple heapTuple, bool *all_dead, bool first_call)
void simple_heap_update(Relation relation, ItemPointer otid, HeapTuple tup, TU_UpdateIndexes *update_indexes)
void heap_freeze_prepared_tuples(Buffer buffer, HeapTupleFreeze *tuples, int ntuples)
static void heap_execute_freeze_tuple(HeapTupleHeader tuple, HeapTupleFreeze *frz)
bool heap_getnextslot_tidrange(TableScanDesc sscan, ScanDirection direction, TupleTableSlot *slot)
void heap_set_tidrange(TableScanDesc sscan, ItemPointer mintid, ItemPointer maxtid)
HTSV_Result HeapTupleSatisfiesVacuum(HeapTuple htup, TransactionId OldestXmin, Buffer buffer)
struct HeapScanDescData HeapScanDescData
void heap_abort_speculative(Relation relation, ItemPointer tid)
struct BitmapHeapScanDescData BitmapHeapScanDescData
TableScanDesc heap_beginscan(Relation relation, Snapshot snapshot, int nkeys, ScanKey key, ParallelTableScanDesc parallel_scan, uint32 flags)
bool heap_getnextslot(TableScanDesc sscan, ScanDirection direction, struct TupleTableSlot *slot)
void heap_prepare_pagescan(TableScanDesc sscan)
void simple_heap_insert(Relation relation, HeapTuple tup)
bool heap_prepare_freeze_tuple(HeapTupleHeader tuple, const struct VacuumCutoffs *cutoffs, HeapPageFreeze *pagefrz, HeapTupleFreeze *frz, bool *totally_frozen)
TM_Result heap_update(Relation relation, ItemPointer otid, HeapTuple newtup, CommandId cid, Snapshot crosscheck, bool wait, struct TM_FailureData *tmfd, LockTupleMode *lockmode, TU_UpdateIndexes *update_indexes)
TransactionId heap_index_delete_tuples(Relation rel, TM_IndexDeleteOp *delstate)
bool HeapTupleHeaderIsOnlyLocked(HeapTupleHeader tuple)
TM_Result heap_lock_tuple(Relation relation, HeapTuple tuple, CommandId cid, LockTupleMode mode, LockWaitPolicy wait_policy, bool follow_updates, Buffer *buffer, struct TM_FailureData *tmfd)
void heap_page_prune_execute(Buffer buffer, bool lp_truncate_only, OffsetNumber *redirected, int nredirected, OffsetNumber *nowdead, int ndead, OffsetNumber *nowunused, int nunused)
TM_Result HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid, Buffer buffer)
struct BulkInsertStateData * BulkInsertState
void heap_get_latest_tid(TableScanDesc sscan, ItemPointer tid)
void heap_setscanlimits(TableScanDesc sscan, BlockNumber startBlk, BlockNumber numBlks)
void HeapCheckForSerializableConflictOut(bool visible, Relation relation, HeapTuple tuple, Buffer buffer, Snapshot snapshot)
struct IndexFetchHeapData IndexFetchHeapData
void FreeBulkInsertState(BulkInsertState)
void heap_pre_freeze_checks(Buffer buffer, HeapTupleFreeze *tuples, int ntuples)
BulkInsertState GetBulkInsertState(void)
static void HeapTupleHeaderSetXvac(HeapTupleHeaderData *tup, TransactionId xid)
#define MaxHeapTuplesPerPage
static void HeapTupleHeaderSetXmax(HeapTupleHeaderData *tup, TransactionId xid)
static PgChecksumMode mode
static HTAB * tuplecid_data
HeapScanDescData rs_heap_base
MultiXactId NoFreezePageRelminMxid
TransactionId FreezePageRelfrozenXid
MultiXactId FreezePageRelminMxid
TransactionId NoFreezePageRelfrozenXid
BufferAccessStrategy rs_strategy
ParallelBlockTableScanWorkerData * rs_parallelworkerdata
BlockNumber rs_startblock
OffsetNumber rs_vistuples[MaxHeapTuplesPerPage]
ReadStream * rs_read_stream
BlockNumber rs_prefetch_block
TableScanDescData rs_base
IndexFetchTableData xs_base
TransactionId vm_conflict_horizon
OffsetNumber deadoffsets[MaxHeapTuplesPerPage]
#define FrozenTransactionId
#define InvalidTransactionId