|
PostgreSQL Source Code git master
|


Go to the source code of this file.
Macros | |
| #define | MaximumBytesPerTuple(tuplesPerPage) |
| #define | TOAST_TUPLES_PER_PAGE 4 |
| #define | TOAST_TUPLE_THRESHOLD MaximumBytesPerTuple(TOAST_TUPLES_PER_PAGE) |
| #define | TOAST_TUPLE_TARGET TOAST_TUPLE_THRESHOLD |
| #define | TOAST_TUPLES_PER_PAGE_MAIN 1 |
| #define | TOAST_TUPLE_TARGET_MAIN MaximumBytesPerTuple(TOAST_TUPLES_PER_PAGE_MAIN) |
| #define | TOAST_INDEX_TARGET (MaxHeapTupleSize / 16) |
| #define | EXTERN_TUPLES_PER_PAGE 4 /* tweak only this */ |
| #define | EXTERN_TUPLE_MAX_SIZE MaximumBytesPerTuple(EXTERN_TUPLES_PER_PAGE) |
| #define | TOAST_MAX_CHUNK_SIZE |
Functions | |
| HeapTuple | heap_toast_insert_or_update (Relation rel, HeapTuple newtup, HeapTuple oldtup, int options) |
| void | heap_toast_delete (Relation rel, HeapTuple oldtup, bool is_speculative) |
| HeapTuple | toast_flatten_tuple (HeapTuple tup, TupleDesc tupleDesc) |
| Datum | toast_flatten_tuple_to_datum (HeapTupleHeader tup, uint32 tup_len, TupleDesc tupleDesc) |
| HeapTuple | toast_build_flattened_tuple (TupleDesc tupleDesc, const Datum *values, const bool *isnull) |
| void | heap_fetch_toast_slice (Relation toastrel, Oid valueid, int32 attrsize, int32 sliceoffset, int32 slicelength, struct varlena *result) |
| #define EXTERN_TUPLE_MAX_SIZE MaximumBytesPerTuple(EXTERN_TUPLES_PER_PAGE) |
Definition at line 82 of file heaptoast.h.
| #define EXTERN_TUPLES_PER_PAGE 4 /* tweak only this */ |
Definition at line 80 of file heaptoast.h.
| #define MaximumBytesPerTuple | ( | tuplesPerPage | ) |
Definition at line 23 of file heaptoast.h.
| #define TOAST_INDEX_TARGET (MaxHeapTupleSize / 16) |
Definition at line 68 of file heaptoast.h.
| #define TOAST_MAX_CHUNK_SIZE |
Definition at line 84 of file heaptoast.h.
| #define TOAST_TUPLE_TARGET TOAST_TUPLE_THRESHOLD |
Definition at line 50 of file heaptoast.h.
| #define TOAST_TUPLE_TARGET_MAIN MaximumBytesPerTuple(TOAST_TUPLES_PER_PAGE_MAIN) |
Definition at line 61 of file heaptoast.h.
| #define TOAST_TUPLE_THRESHOLD MaximumBytesPerTuple(TOAST_TUPLES_PER_PAGE) |
Definition at line 48 of file heaptoast.h.
| #define TOAST_TUPLES_PER_PAGE 4 |
Definition at line 46 of file heaptoast.h.
| #define TOAST_TUPLES_PER_PAGE_MAIN 1 |
Definition at line 59 of file heaptoast.h.
| void heap_fetch_toast_slice | ( | Relation | toastrel, |
| Oid | valueid, | ||
| int32 | attrsize, | ||
| int32 | sliceoffset, | ||
| int32 | slicelength, | ||
| struct varlena * | result | ||
| ) |
Definition at line 626 of file heaptoast.c.
References AccessShareLock, Assert(), BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, BTLessEqualStrategyNumber, DatumGetInt32(), DatumGetPointer(), elog, ereport, errcode(), ERRCODE_DATA_CORRUPTED, errmsg_internal(), ERROR, fastgetattr(), ForwardScanDirection, get_toast_snapshot(), Int32GetDatum(), ObjectIdGetDatum(), RelationData::rd_att, RelationGetRelationName, ScanKeyInit(), systable_beginscan_ordered(), systable_endscan_ordered(), systable_getnext_ordered(), toast_close_indexes(), TOAST_MAX_CHUNK_SIZE, toast_open_indexes(), VARATT_IS_EXTENDED(), VARATT_IS_SHORT(), VARDATA(), VARDATA_SHORT(), VARHDRSZ, VARHDRSZ_SHORT, VARSIZE(), and VARSIZE_SHORT().
Definition at line 43 of file heaptoast.c.
References Assert(), heap_deform_tuple(), MaxHeapAttributeNumber, TupleDescData::natts, RelationData::rd_att, RelationData::rd_rel, and toast_delete_external().
Referenced by heap_abort_speculative(), and heap_delete().
| HeapTuple heap_toast_insert_or_update | ( | Relation | rel, |
| HeapTuple | newtup, | ||
| HeapTuple | oldtup, | ||
| int | options | ||
| ) |
Definition at line 96 of file heaptoast.c.
References Assert(), attstorage, BITMAPLEN(), heap_compute_data_size(), heap_deform_tuple(), heap_fill_tuple(), HeapTupleHeaderSetNatts, HEAPTUPLESIZE, InvalidOid, MAXALIGN, MaxHeapAttributeNumber, TupleDescData::natts, palloc0(), RelationData::rd_att, RelationData::rd_rel, RelationGetToastTupleTarget, SizeofHeapTupleHeader, HeapTupleHeaderData::t_bits, HeapTupleData::t_data, HeapTupleHeaderData::t_hoff, HeapTupleHeaderData::t_infomask, HeapTupleData::t_len, HeapTupleData::t_self, HeapTupleData::t_tableOid, ToastAttrInfo::tai_colflags, TOAST_HAS_NULLS, TOAST_NEEDS_CHANGE, toast_tuple_cleanup(), toast_tuple_externalize(), toast_tuple_find_biggest_attribute(), toast_tuple_init(), TOAST_TUPLE_TARGET, TOAST_TUPLE_TARGET_MAIN, toast_tuple_try_compression(), TOASTCOL_INCOMPRESSIBLE, ToastTupleContext::ttc_attr, ToastTupleContext::ttc_flags, ToastTupleContext::ttc_isnull, ToastTupleContext::ttc_oldisnull, ToastTupleContext::ttc_oldvalues, ToastTupleContext::ttc_rel, ToastTupleContext::ttc_values, and TupleDescAttr().
Referenced by heap_prepare_insert(), heap_update(), and raw_heap_insert().
| HeapTuple toast_build_flattened_tuple | ( | TupleDesc | tupleDesc, |
| const Datum * | values, | ||
| const bool * | isnull | ||
| ) |
Definition at line 563 of file heaptoast.c.
References Assert(), attlen, DatumGetPointer(), detoast_external_attr(), heap_form_tuple(), i, MaxTupleAttributeNumber, TupleDescData::natts, pfree(), PointerGetDatum(), TupleDescCompactAttr(), values, and VARATT_IS_EXTERNAL().
Referenced by ExecEvalWholeRowVar().
Definition at line 350 of file heaptoast.c.
References Assert(), attlen, DatumGetPointer(), detoast_external_attr(), HEAP2_XACT_MASK, heap_deform_tuple(), heap_form_tuple(), HEAP_XACT_MASK, i, MaxTupleAttributeNumber, TupleDescData::natts, pfree(), PointerGetDatum(), HeapTupleHeaderData::t_choice, HeapTupleHeaderData::t_ctid, HeapTupleData::t_data, HeapTupleHeaderData::t_infomask, HeapTupleHeaderData::t_infomask2, HeapTupleData::t_self, HeapTupleData::t_tableOid, TupleDescCompactAttr(), and VARATT_IS_EXTERNAL().
Referenced by CatalogCacheCreateEntry(), expanded_record_set_tuple(), and ExtractReplicaIdentity().
| Datum toast_flatten_tuple_to_datum | ( | HeapTupleHeader | tup, |
| uint32 | tup_len, | ||
| TupleDesc | tupleDesc | ||
| ) |
Definition at line 449 of file heaptoast.c.
References Assert(), attlen, BITMAPLEN(), DatumGetPointer(), detoast_attr(), heap_compute_data_size(), heap_deform_tuple(), heap_fill_tuple(), HeapTupleHeaderSetDatumLength(), HeapTupleHeaderSetNatts, HeapTupleHeaderSetTypeId(), HeapTupleHeaderSetTypMod(), i, InvalidOid, ItemPointerSetInvalid(), MAXALIGN, MaxTupleAttributeNumber, TupleDescData::natts, palloc0(), pfree(), PointerGetDatum(), SizeofHeapTupleHeader, HeapTupleHeaderData::t_bits, HeapTupleData::t_data, HeapTupleHeaderData::t_hoff, HeapTupleHeaderData::t_infomask, HeapTupleData::t_len, HeapTupleData::t_self, HeapTupleData::t_tableOid, TupleDescData::tdtypeid, TupleDescData::tdtypmod, TupleDescCompactAttr(), VARATT_IS_COMPRESSED(), and VARATT_IS_EXTERNAL().
Referenced by heap_copy_tuple_as_datum(), and HeapTupleHeaderGetDatum().