PostgreSQL Source Code
git master
|
#include "access/toast_compression.h"
#include "storage/lockdefs.h"
#include "utils/relcache.h"
#include "utils/snapshot.h"
Go to the source code of this file.
Data Structures | |
struct | toast_compress_header |
Macros | |
#define | TOAST_COMPRESS_EXTSIZE(ptr) (((toast_compress_header *) (ptr))->tcinfo & VARLENA_EXTSIZE_MASK) |
#define | TOAST_COMPRESS_METHOD(ptr) (((toast_compress_header *) (ptr))->tcinfo >> VARLENA_EXTSIZE_BITS) |
#define | TOAST_COMPRESS_SET_SIZE_AND_COMPRESS_METHOD(ptr, len, cm_method) |
Typedefs | |
typedef struct toast_compress_header | toast_compress_header |
Functions | |
Datum | toast_compress_datum (Datum value, char cmethod) |
Oid | toast_get_valid_index (Oid toastoid, LOCKMODE lock) |
void | toast_delete_datum (Relation rel, Datum value, bool is_speculative) |
Datum | toast_save_datum (Relation rel, Datum value, struct varlena *oldexternal, int options) |
int | toast_open_indexes (Relation toastrel, LOCKMODE lock, Relation **toastidxs, int *num_indexes) |
void | toast_close_indexes (Relation *toastidxs, int num_indexes, LOCKMODE lock) |
Snapshot | get_toast_snapshot (void) |
#define TOAST_COMPRESS_EXTSIZE | ( | ptr | ) | (((toast_compress_header *) (ptr))->tcinfo & VARLENA_EXTSIZE_MASK) |
Definition at line 34 of file toast_internals.h.
#define TOAST_COMPRESS_METHOD | ( | ptr | ) | (((toast_compress_header *) (ptr))->tcinfo >> VARLENA_EXTSIZE_BITS) |
Definition at line 36 of file toast_internals.h.
#define TOAST_COMPRESS_SET_SIZE_AND_COMPRESS_METHOD | ( | ptr, | |
len, | |||
cm_method | |||
) |
Definition at line 39 of file toast_internals.h.
typedef struct toast_compress_header toast_compress_header |
Snapshot get_toast_snapshot | ( | void | ) |
Definition at line 638 of file toast_internals.c.
References elog, ERROR, HaveRegisteredOrActiveSnapshot(), and SnapshotToastData.
Referenced by check_toasted_attribute(), heap_fetch_toast_slice(), and toast_delete_datum().
Definition at line 621 of file toast_internals.c.
References i, index_close(), and pfree().
Referenced by heap_fetch_toast_slice(), toast_delete_datum(), toast_get_valid_index(), toast_save_datum(), toastrel_valueid_exists(), and verify_heapam().
Definition at line 46 of file toast_internals.c.
References Assert, CompressionMethodIsValid, DatumGetPointer(), default_toast_compression, elog, ERROR, lz4_compress_datum(), pfree(), pglz_compress_datum(), PointerGetDatum(), TOAST_COMPRESS_SET_SIZE_AND_COMPRESS_METHOD, TOAST_INVALID_COMPRESSION_ID, TOAST_LZ4_COMPRESSION, TOAST_LZ4_COMPRESSION_ID, TOAST_PGLZ_COMPRESSION, TOAST_PGLZ_COMPRESSION_ID, value, VARATT_IS_COMPRESSED, VARATT_IS_EXTERNAL, VARSIZE, and VARSIZE_ANY_EXHDR.
Referenced by brin_form_tuple(), index_form_tuple_context(), and toast_tuple_try_compression().
Definition at line 385 of file toast_internals.c.
References BTEqualStrategyNumber, DatumGetPointer(), ForwardScanDirection, get_toast_snapshot(), heap_abort_speculative(), NoLock, ObjectIdGetDatum(), RowExclusiveLock, ScanKeyInit(), simple_heap_delete(), systable_beginscan_ordered(), systable_endscan_ordered(), systable_getnext_ordered(), HeapTupleData::t_self, table_close(), table_open(), toast_close_indexes(), toast_open_indexes(), varatt_external::va_toastrelid, varatt_external::va_valueid, value, VARATT_EXTERNAL_GET_POINTER, and VARATT_IS_EXTERNAL_ONDISK.
Referenced by toast_delete_external(), and toast_tuple_cleanup().
Definition at line 528 of file toast_internals.c.
References NoLock, RelationGetRelid, table_close(), table_open(), toast_close_indexes(), and toast_open_indexes().
Referenced by finish_heap_swap(), and swap_relation_files().
int toast_open_indexes | ( | Relation | toastrel, |
LOCKMODE | lock, | ||
Relation ** | toastidxs, | ||
int * | num_indexes | ||
) |
Definition at line 562 of file toast_internals.c.
References Assert, elog, ERROR, i, index_open(), lfirst_oid, list_free(), list_length(), NIL, palloc(), RelationData::rd_index, RelationGetIndexList(), RelationGetRelid, and res.
Referenced by heap_fetch_toast_slice(), toast_delete_datum(), toast_get_valid_index(), toast_save_datum(), toastrel_valueid_exists(), and verify_heapam().
Definition at line 119 of file toast_internals.c.
References Assert, CHECK_FOR_INTERRUPTS, data, DatumGetPointer(), GetCurrentCommandId(), GetNewOidWithIndex(), heap_form_tuple(), heap_freetuple(), heap_insert(), i, index_insert(), Int32GetDatum(), InvalidOid, Min, NoLock, ObjectIdGetDatum(), OidIsValid, palloc(), PointerGetDatum(), RelationData::rd_att, RelationData::rd_index, RelationData::rd_rel, RelationData::rd_toastoid, RelationGetRelid, RowExclusiveLock, SET_VARSIZE, SET_VARTAG_EXTERNAL, HeapTupleData::t_self, table_close(), table_open(), toast_close_indexes(), TOAST_MAX_CHUNK_SIZE, toast_open_indexes(), TOAST_POINTER_SIZE, toastid_valueid_exists(), toastrel_valueid_exists(), UNIQUE_CHECK_NO, UNIQUE_CHECK_YES, varatt_external::va_extinfo, varatt_external::va_rawsize, varatt_external::va_toastrelid, varatt_external::va_valueid, value, VARATT_EXTERNAL_GET_POINTER, VARATT_EXTERNAL_IS_COMPRESSED, VARATT_EXTERNAL_SET_SIZE_AND_COMPRESS_METHOD, VARATT_IS_COMPRESSED, VARATT_IS_EXTERNAL, VARATT_IS_EXTERNAL_ONDISK, VARATT_IS_SHORT, VARDATA, VARDATA_COMPRESSED_GET_COMPRESS_METHOD, VARDATA_COMPRESSED_GET_EXTSIZE, VARDATA_EXTERNAL, VARDATA_SHORT, VARHDRSZ, VARHDRSZ_SHORT, VARSIZE, VARSIZE_SHORT, and VARTAG_ONDISK.
Referenced by toast_tuple_externalize().