PostgreSQL Source Code
git master
|
#include "access/htup.h"
#include "storage/itemptr.h"
#include "storage/relfilelocator.h"
#include "utils/relcache.h"
Go to the source code of this file.
Data Structures | |
struct | LogicalRewriteMappingData |
Macros | |
#define | LOGICAL_REWRITE_FORMAT "map-%x-%x-%X_%X-%x-%x" |
Typedefs | |
typedef struct RewriteStateData * | RewriteState |
typedef struct LogicalRewriteMappingData | LogicalRewriteMappingData |
Functions | |
RewriteState | begin_heap_rewrite (Relation old_heap, Relation new_heap, TransactionId oldest_xmin, TransactionId freeze_xid, MultiXactId cutoff_multi) |
void | end_heap_rewrite (RewriteState state) |
void | rewrite_heap_tuple (RewriteState state, HeapTuple old_tuple, HeapTuple new_tuple) |
bool | rewrite_heap_dead_tuple (RewriteState state, HeapTuple old_tuple) |
void | CheckPointLogicalRewriteHeap (void) |
typedef struct LogicalRewriteMappingData LogicalRewriteMappingData |
typedef struct RewriteStateData* RewriteState |
Definition at line 22 of file rewriteheap.h.
RewriteState begin_heap_rewrite | ( | Relation | old_heap, |
Relation | new_heap, | ||
TransactionId | oldest_xmin, | ||
TransactionId | freeze_xid, | ||
MultiXactId | cutoff_multi | ||
) |
Definition at line 234 of file rewriteheap.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, CurrentMemoryContext, HASHCTL::entrysize, HASH_BLOBS, HASH_CONTEXT, hash_create(), HASH_ELEM, HASHCTL::hcxt, HASHCTL::keysize, logical_begin_heap_rewrite(), MAIN_FORKNUM, MemoryContextSwitchTo(), palloc0(), RelationGetNumberOfBlocks, and smgr_bulk_start_rel().
Referenced by heapam_relation_copy_for_cluster().
void CheckPointLogicalRewriteHeap | ( | void | ) |
Definition at line 1155 of file rewriteheap.c.
References AllocateDir(), CloseTransientFile(), dirent::d_name, data_sync_elevel(), DEBUG1, elog, ereport, errcode_for_file_access(), errmsg(), ERROR, fd(), FreeDir(), fsync_fname(), get_dirent_type(), GetRedoRecPtr(), InvalidXLogRecPtr, LOGICAL_REWRITE_FORMAT, MAXPGPATH, OpenTransientFile(), PG_BINARY, pg_fsync(), PG_LOGICAL_MAPPINGS_DIR, PGFILETYPE_ERROR, PGFILETYPE_REG, pgstat_report_wait_end(), pgstat_report_wait_start(), ReadDir(), ReplicationSlotsComputeLogicalRestartLSN(), and snprintf.
Referenced by CheckPointGuts().
void end_heap_rewrite | ( | RewriteState | state | ) |
Definition at line 297 of file rewriteheap.c.
References hash_seq_init(), hash_seq_search(), ItemPointerSetInvalid(), logical_end_heap_rewrite(), MemoryContextDelete(), raw_heap_insert(), smgr_bulk_finish(), smgr_bulk_write(), HeapTupleHeaderData::t_ctid, HeapTupleData::t_data, and UnresolvedTupData::tuple.
Referenced by heapam_relation_copy_for_cluster().
bool rewrite_heap_dead_tuple | ( | RewriteState | state, |
HeapTuple | old_tuple | ||
) |
Definition at line 543 of file rewriteheap.c.
References Assert, HASH_FIND, HASH_REMOVE, hash_search(), heap_freetuple(), HeapTupleHeaderGetXmin, HeapTupleData::t_data, HeapTupleData::t_self, TidHashKey::tid, UnresolvedTupData::tuple, and TidHashKey::xmin.
Referenced by heapam_relation_copy_for_cluster().
void rewrite_heap_tuple | ( | RewriteState | state, |
HeapTuple | old_tuple, | ||
HeapTuple | new_tuple | ||
) |
Definition at line 341 of file rewriteheap.c.
References Assert, HASH_ENTER, HASH_FIND, HASH_REMOVE, hash_search(), HEAP2_XACT_MASK, heap_copytuple(), heap_freetuple(), heap_freeze_tuple(), HEAP_UPDATED, HEAP_XACT_MASK, HEAP_XMAX_INVALID, HeapTupleHeaderGetUpdateXid, HeapTupleHeaderGetXmin, HeapTupleHeaderIndicatesMovedPartitions, HeapTupleHeaderIsOnlyLocked(), ItemPointerEquals(), ItemPointerSetInvalid(), logical_rewrite_heap_tuple(), MemoryContextSwitchTo(), OldToNewMappingData::new_tid, UnresolvedTupData::old_tid, raw_heap_insert(), HeapTupleHeaderData::t_choice, HeapTupleHeaderData::t_ctid, HeapTupleData::t_data, HeapTupleHeaderData::t_heap, HeapTupleHeaderData::t_infomask, HeapTupleHeaderData::t_infomask2, HeapTupleData::t_self, TidHashKey::tid, TransactionIdPrecedes(), UnresolvedTupData::tuple, and TidHashKey::xmin.
Referenced by reform_and_rewrite_tuple().