PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "access/itup.h"
#include "access/xlog.h"
#include "pgstat.h"
#include "storage/checksum.h"
#include "utils/memdebug.h"
#include "utils/memutils.h"
Go to the source code of this file.
Data Structures | |
struct | itemIdCompactData |
Typedefs | |
typedef struct itemIdCompactData | itemIdCompactData |
typedef itemIdCompactData * | itemIdCompact |
Variables | |
bool | ignore_checksum_failure = false |
typedef itemIdCompactData* itemIdCompact |
typedef struct itemIdCompactData itemIdCompactData |
|
static |
Definition at line 463 of file bufpage.c.
References itemIdCompactData::alignedlen, Assert, PGAlignedBlock::data, i, itemIdCompactData::itemoff, ItemIdData::lp_off, nitems, itemIdCompactData::offsetindex, PageGetItemId(), PageGetMaxOffsetNumber(), PageHeaderData::pd_special, PageHeaderData::pd_upper, and upper().
Referenced by PageIndexMultiDelete(), and PageRepairFragmentation().
OffsetNumber PageAddItemExtended | ( | Page | page, |
Item | item, | ||
Size | size, | ||
OffsetNumber | offsetNumber, | ||
int | flags | ||
) |
Definition at line 183 of file bufpage.c.
References Assert, elog, ereport, errcode(), ERRCODE_DATA_CORRUPTED, errmsg(), FirstOffsetNumber, InvalidOffsetNumber, ItemIdHasStorage, ItemIdIsUsed, ItemIdSetNormal, lower(), MAXALIGN, MaxHeapTuplesPerPage, OffsetNumberIsValid, OffsetNumberNext, PageClearHasFreeLinePointers(), PageGetItemId(), PageGetMaxOffsetNumber(), PageHasFreeLinePointers(), PAI_IS_HEAP, PAI_OVERWRITE, PANIC, PageHeaderData::pd_lower, PageHeaderData::pd_special, PageHeaderData::pd_upper, size, SizeOfPageHeaderData, upper(), VALGRIND_CHECK_MEM_IS_DEFINED, and WARNING.
Definition at line 947 of file bufpage.c.
Referenced by _bt_bottomupdel_pass(), _bt_dedup_pass(), _bt_findsplitloc(), allocNewBuffer(), brin_can_do_samepage_update(), doPickSplit(), GetHashPageStats(), ginHeapTupleFastInsert(), pgstat_heap(), pgstat_index_page(), pgstatindex_impl(), spgAddNodeAction(), SpGistGetBuffer(), SpGistPageAddNewItem(), SpGistSetLastUsedPage(), statapprox_heap(), and writeListPage().
Definition at line 896 of file bufpage.c.
Referenced by _bt_buildadd(), _bt_delete_or_dedup_one_page(), _bt_findinsertloc(), _bt_insertonpg(), _bt_search_insert(), _hash_doinsert(), br_page_get_freespace(), entryIsEnoughSpace(), GetBTPageStatistics(), GetHashPageStatistics(), gist_indexsortbuild_levelstate_add(), gistnospace(), heap_xlog_visible(), PageGetHeapFreeSpace(), and terminate_brin_buildstate().
Definition at line 923 of file bufpage.c.
Referenced by _hash_splitbucket(), and _hash_squeezebucket().
Definition at line 980 of file bufpage.c.
References FirstOffsetNumber, ItemIdIsUsed, MaxHeapTuplesPerPage, OffsetNumberNext, PageGetFreeSpace(), PageGetItemId(), PageGetMaxOffsetNumber(), and PageHasFreeLinePointers().
Referenced by heap_multi_insert(), heap_page_prune_opt(), heap_update(), heap_xlog_insert(), heap_xlog_multi_insert(), heap_xlog_prune_freeze(), heap_xlog_update(), lazy_scan_heap(), lazy_scan_new_or_empty(), lazy_vacuum_heap_rel(), raw_heap_insert(), and RelationGetBufferForTuple().
Definition at line 354 of file bufpage.c.
References PageGetPageSize(), and palloc().
Referenced by _bt_split(), dataSplitPageInternal(), and ginPlaceToPage().
Definition at line 371 of file bufpage.c.
References PageGetPageSize(), and palloc().
Referenced by entrySplitPage(), and ginVacuumEntryPage().
Definition at line 391 of file bufpage.c.
References PageGetPageSize(), PageGetSpecialPointer(), PageGetSpecialSize(), PageInit(), and palloc().
Referenced by _bt_dedup_pass(), btree_xlog_dedup(), btree_xlog_split(), and gistplacetopage().
void PageIndexMultiDelete | ( | Page | page, |
OffsetNumber * | itemnos, | ||
int | nitems | ||
) |
Definition at line 1150 of file bufpage.c.
References itemIdCompactData::alignedlen, Assert, compactify_tuples(), elog, ereport, errcode(), ERRCODE_DATA_CORRUPTED, errmsg(), ERROR, FirstOffsetNumber, ItemIdGetLength, ItemIdGetOffset, ItemIdHasStorage, itemIdCompactData::itemoff, MAXALIGN, MaxIndexTuplesPerPage, nitems, itemIdCompactData::offsetindex, OffsetNumberNext, PageGetItemId(), PageGetMaxOffsetNumber(), PageIndexTupleDelete(), PageHeaderData::pd_linp, PageHeaderData::pd_lower, PageHeaderData::pd_special, PageHeaderData::pd_upper, size, and SizeOfPageHeaderData.
Referenced by _bt_delitems_delete(), _bt_delitems_vacuum(), _hash_squeezebucket(), _hash_vacuum_one_page(), btree_xlog_delete(), btree_xlog_vacuum(), gistprunepage(), gistRedoDeleteRecord(), gistRedoPageUpdateRecord(), gistvacuumpage(), hash_xlog_delete(), hash_xlog_move_page_contents(), hash_xlog_vacuum_one_page(), hashbucketcleanup(), spgPageIndexMultiDelete(), spgRedoVacuumRedirect(), spgRedoVacuumRoot(), vacuumLeafRoot(), and vacuumRedirectAndPlaceholder().
void PageIndexTupleDelete | ( | Page | page, |
OffsetNumber | offnum | ||
) |
Definition at line 1041 of file bufpage.c.
References Assert, elog, ereport, errcode(), ERRCODE_DATA_CORRUPTED, errmsg(), ERROR, i, if(), ItemIdGetLength, ItemIdGetOffset, ItemIdHasStorage, ItemIdData::lp_off, MAXALIGN, PageGetItemId(), PageGetMaxOffsetNumber(), PageIsEmpty(), PageHeaderData::pd_linp, PageHeaderData::pd_lower, PageHeaderData::pd_special, PageHeaderData::pd_upper, size, and SizeOfPageHeaderData.
Referenced by _bt_mark_page_halfdead(), addLeafTuple(), addOrReplaceTuple(), btree_xlog_mark_page_halfdead(), entryPreparePage(), ginRedoInsertEntry(), ginVacuumEntryPage(), gistdeletepage(), gistplacetopage(), gistRedoPageDelete(), PageIndexMultiDelete(), spgAddNodeAction(), SpGistPageAddNewItem(), spgRedoAddLeaf(), spgRedoAddNode(), spgRedoSplitTuple(), and spgSplitNodeAction().
void PageIndexTupleDeleteNoCompact | ( | Page | page, |
OffsetNumber | offnum | ||
) |
Definition at line 1284 of file bufpage.c.
References Assert, elog, ereport, errcode(), ERRCODE_DATA_CORRUPTED, errmsg(), ERROR, i, if(), ItemIdGetLength, ItemIdGetOffset, ItemIdHasStorage, ItemIdSetUnused, ItemIdData::lp_off, MAXALIGN, PageGetItemId(), PageGetMaxOffsetNumber(), PageIsEmpty(), PageHeaderData::pd_lower, PageHeaderData::pd_special, PageHeaderData::pd_upper, size, and SizeOfPageHeaderData.
Referenced by brin_doupdate(), brin_xlog_desummarize_page(), brin_xlog_update(), and brinRevmapDesummarizeRange().
bool PageIndexTupleOverwrite | ( | Page | page, |
OffsetNumber | offnum, | ||
Item | newtup, | ||
Size | newsize | ||
) |
Definition at line 1394 of file bufpage.c.
References Assert, elog, ereport, errcode(), ERRCODE_DATA_CORRUPTED, errmsg(), ERROR, FirstOffsetNumber, i, ItemIdGetLength, ItemIdGetOffset, ItemIdHasStorage, ItemIdData::lp_len, ItemIdData::lp_off, MAXALIGN, PageGetItem(), PageGetItemId(), PageGetMaxOffsetNumber(), PageHeaderData::pd_lower, PageHeaderData::pd_special, PageHeaderData::pd_upper, and SizeOfPageHeaderData.
Referenced by _bt_buildadd(), _bt_delitems_delete(), _bt_delitems_vacuum(), _bt_mark_page_halfdead(), brin_doupdate(), brin_xlog_samepage_update(), btree_xlog_updates(), gistplacetopage(), and gistRedoPageUpdateRecord().
Definition at line 42 of file bufpage.c.
References Assert, MAXALIGN, MemSet, PageSetPageSizeAndVersion(), PageHeaderData::pd_flags, PageHeaderData::pd_lower, PageHeaderData::pd_special, PageHeaderData::pd_upper, PG_PAGE_LAYOUT_VERSION, and SizeOfPageHeaderData.
Referenced by _bt_pageinit(), _hash_pageinit(), BloomInitPage(), brin_page_init(), fill_seq_fork_with_data(), fsm_readbuf(), GinInitPage(), gistinitpage(), heap_xlog_insert(), heap_xlog_multi_insert(), heap_xlog_update(), heap_xlog_visible(), PageGetTempPageCopySpecial(), raw_heap_insert(), RelationAddBlocks(), RelationGetBufferForTuple(), seq_redo(), SpGistInitPage(), vm_readbuf(), and XLogRecordPageWithFreeSpace().
bool PageIsVerifiedExtended | ( | Page | page, |
BlockNumber | blkno, | ||
int | flags | ||
) |
Definition at line 88 of file bufpage.c.
References checksum_failure, DataChecksumsEnabled(), ereport, errcode(), ERRCODE_DATA_CORRUPTED, errmsg(), ignore_checksum_failure, MAXALIGN, PageIsNew(), PageHeaderData::pd_checksum, PageHeaderData::pd_flags, PageHeaderData::pd_lower, PageHeaderData::pd_special, PageHeaderData::pd_upper, PD_VALID_FLAG_BITS, pg_checksum_page(), pg_memory_is_all_zeros(), pgstat_report_checksum_failure(), PIV_LOG_WARNING, PIV_REPORT_STAT, and WARNING.
Referenced by RelationCopyStorage(), and WaitReadBuffers().
void PageRepairFragmentation | ( | Page | page | ) |
Definition at line 688 of file bufpage.c.
References itemIdCompactData::alignedlen, Assert, compactify_tuples(), ereport, errcode(), ERRCODE_DATA_CORRUPTED, errmsg(), ERROR, FirstOffsetNumber, i, InvalidOffsetNumber, ItemIdGetLength, ItemIdGetOffset, ItemIdHasStorage, ItemIdIsUsed, ItemIdSetUnused, itemIdCompactData::itemoff, MAXALIGN, MaxHeapTuplesPerPage, itemIdCompactData::offsetindex, PageClearHasFreeLinePointers(), PageGetItemId(), PageGetMaxOffsetNumber(), PageSetHasFreeLinePointers(), SizeOfPageHeaderData, and unlikely.
Referenced by heap_page_prune_execute().
Definition at line 413 of file bufpage.c.
References PageGetPageSize(), and pfree().
Referenced by _bt_dedup_pass(), _bt_split(), btree_xlog_dedup(), btree_xlog_split(), createPostingTree(), ginbulkdelete(), and gistplacetopage().
char* PageSetChecksumCopy | ( | Page | page, |
BlockNumber | blkno | ||
) |
Definition at line 1499 of file bufpage.c.
References DataChecksumsEnabled(), MemoryContextAllocAligned(), PageIsNew(), pg_checksum_page(), PG_IO_ALIGN_SIZE, and TopMemoryContext.
Referenced by FlushBuffer().
void PageSetChecksumInplace | ( | Page | page, |
BlockNumber | blkno | ||
) |
Definition at line 1531 of file bufpage.c.
References DataChecksumsEnabled(), PageIsNew(), and pg_checksum_page().
Referenced by _hash_alloc_buckets(), FlushRelationBuffers(), GetLocalVictimBuffer(), and smgr_bulk_flush().
void PageTruncateLinePointerArray | ( | Page | page | ) |
Definition at line 824 of file bufpage.c.
References Assert, FirstOffsetNumber, i, ItemIdIsUsed, PageClearHasFreeLinePointers(), PageGetItemId(), PageGetMaxOffsetNumber(), PageSetHasFreeLinePointers(), and PageHeaderData::pd_lower.
Referenced by heap_page_prune_execute(), and lazy_vacuum_heap_page().
bool ignore_checksum_failure = false |
Definition at line 27 of file bufpage.c.
Referenced by PageIsVerifiedExtended().