PostgreSQL Source Code git master
|
#include "postgres.h"
#include "access/brin_page.h"
#include "access/brin_pageops.h"
#include "access/brin_revmap.h"
#include "access/brin_xlog.h"
#include "access/xloginsert.h"
#include "miscadmin.h"
#include "storage/bufmgr.h"
#include "storage/freespace.h"
#include "storage/lmgr.h"
#include "utils/rel.h"
Go to the source code of this file.
Macros | |
#define | BrinMaxItemSize |
#define BrinMaxItemSize |
Definition at line 28 of file brin_pageops.c.
Definition at line 916 of file brin_pageops.c.
References BRIN_EVACUATE_PAGE, BRIN_IS_REGULAR_PAGE, BrinPageFlags, and PageGetFreeSpace().
Referenced by brin_doinsert(), brin_doupdate(), brin_getinsertbuffer(), brin_initialize_empty_new_buffer(), and brin_page_cleanup().
Definition at line 323 of file brin_pageops.c.
References BufferGetPage(), and PageGetExactFreeSpace().
Referenced by brin_doupdate(), brininsert(), and summarize_range().
OffsetNumber brin_doinsert | ( | Relation | idxrel, |
BlockNumber | pagesPerRange, | ||
BrinRevmap * | revmap, | ||
Buffer * | buffer, | ||
BlockNumber | heapBlk, | ||
BrinTuple * | tup, | ||
Size | itemsz | ||
) |
Definition at line 342 of file brin_pageops.c.
References Assert, br_page_get_freespace(), BRIN_elog, brin_getinsertbuffer(), brin_page_init(), BRIN_PAGETYPE_REGULAR, brinLockRevmapPageForUpdate(), BrinMaxItemSize, brinRevmapExtend(), brinSetHeapBlockItemptr(), BUFFER_LOCK_EXCLUSIVE, BUFFER_LOCK_UNLOCK, BufferGetBlockNumber(), BufferGetPage(), BufferIsValid(), DEBUG2, elog, END_CRIT_SECTION, ereport, errcode(), errmsg(), ERROR, FreeSpaceMapVacuumRange(), xl_brin_insert::heapBlk, InvalidBuffer, InvalidOffsetNumber, ItemPointerSet(), LockBuffer(), MarkBufferDirty(), MAXALIGN, xl_brin_insert::offnum, PageAddItem, PageSetLSN(), xl_brin_insert::pagesPerRange, RecordPageWithFreeSpace(), REGBUF_STANDARD, REGBUF_WILL_INIT, RelationGetRelationName, RelationNeedsWAL, SizeOfBrinInsert, START_CRIT_SECTION, UnlockReleaseBuffer(), XLOG_BRIN_INIT_PAGE, XLOG_BRIN_INSERT, XLogBeginInsert(), XLogInsert(), XLogRegisterBufData(), XLogRegisterBuffer(), and XLogRegisterData().
Referenced by _brin_parallel_merge(), brin_fill_empty_ranges(), form_and_insert_tuple(), and summarize_range().
bool brin_doupdate | ( | Relation | idxrel, |
BlockNumber | pagesPerRange, | ||
BrinRevmap * | revmap, | ||
BlockNumber | heapBlk, | ||
Buffer | oldbuf, | ||
OffsetNumber | oldoff, | ||
const BrinTuple * | origtup, | ||
Size | origsz, | ||
const BrinTuple * | newtup, | ||
Size | newsz, | ||
bool | samepage | ||
) |
Definition at line 53 of file brin_pageops.c.
References Assert, br_page_get_freespace(), brin_can_do_samepage_update(), BRIN_EVACUATE_PAGE, brin_getinsertbuffer(), brin_initialize_empty_new_buffer(), BRIN_IS_REGULAR_PAGE, brin_page_init(), BRIN_PAGETYPE_REGULAR, brin_tuples_equal(), brinLockRevmapPageForUpdate(), BrinMaxItemSize, BrinPageFlags, brinRevmapExtend(), brinSetHeapBlockItemptr(), BUFFER_LOCK_EXCLUSIVE, BUFFER_LOCK_UNLOCK, BufferGetBlockNumber(), BufferGetPage(), BufferIsValid(), elog, END_CRIT_SECTION, ereport, errcode(), errmsg(), ERROR, FreeSpaceMapVacuumRange(), xl_brin_insert::heapBlk, xl_brin_update::insert, InvalidBlockNumber, InvalidBuffer, InvalidOffsetNumber, ItemIdGetLength, ItemIdIsNormal, ItemPointerSet(), LockBuffer(), MarkBufferDirty(), MAXALIGN, xl_brin_insert::offnum, xl_brin_samepage_update::offnum, xl_brin_update::oldOffnum, PageAddItem, PageGetItem(), PageGetItemId(), PageGetMaxOffsetNumber(), PageIndexTupleDeleteNoCompact(), PageIndexTupleOverwrite(), PageSetLSN(), xl_brin_insert::pagesPerRange, RecordPageWithFreeSpace(), REGBUF_STANDARD, REGBUF_WILL_INIT, RelationGetRelationName, RelationNeedsWAL, SizeOfBrinSamepageUpdate, SizeOfBrinUpdate, START_CRIT_SECTION, unconstify, UnlockReleaseBuffer(), XLOG_BRIN_INIT_PAGE, XLOG_BRIN_SAMEPAGE_UPDATE, XLOG_BRIN_UPDATE, XLogBeginInsert(), XLogInsert(), XLogRegisterBufData(), XLogRegisterBuffer(), and XLogRegisterData().
Referenced by brin_evacuate_page(), brininsert(), and summarize_range().
void brin_evacuate_page | ( | Relation | idxRel, |
BlockNumber | pagesPerRange, | ||
BrinRevmap * | revmap, | ||
Buffer | buf | ||
) |
Definition at line 564 of file brin_pageops.c.
References Assert, brin_copy_tuple(), brin_doupdate(), BRIN_EVACUATE_PAGE, BRIN_IS_REGULAR_PAGE, BrinPageFlags, BrinTuple::bt_blkno, buf, BUFFER_LOCK_SHARE, BUFFER_LOCK_UNLOCK, BufferGetPage(), CHECK_FOR_INTERRUPTS, FirstOffsetNumber, ItemIdGetLength, ItemIdIsUsed, LockBuffer(), PageGetItem(), PageGetItemId(), PageGetMaxOffsetNumber(), and UnlockReleaseBuffer().
Referenced by revmap_physical_extend().
|
static |
Definition at line 690 of file brin_pageops.c.
References Assert, br_page_get_freespace(), BRIN_elog, brin_initialize_empty_new_buffer(), BRIN_IS_REGULAR_PAGE, BrinMaxItemSize, buf, BUFFER_LOCK_EXCLUSIVE, BUFFER_LOCK_UNLOCK, BufferGetBlockNumber(), BufferGetPage(), BufferIsValid(), CHECK_FOR_INTERRUPTS, DEBUG2, ereport, errcode(), errmsg(), ERROR, ExclusiveLock, FreeSpaceMapVacuumRange(), GetPageWithFreeSpace(), InvalidBlockNumber, InvalidBuffer, LockBuffer(), LockRelationForExtension(), P_NEW, ReadBuffer(), RecordAndGetPageWithFreeSpace(), RELATION_IS_LOCAL, RelationGetRelationName, RelationGetTargetBlock, RelationSetTargetBlock, ReleaseBuffer(), UnlockRelationForExtension(), and UnlockReleaseBuffer().
Referenced by brin_doinsert(), and brin_doupdate().
Definition at line 884 of file brin_pageops.c.
References br_page_get_freespace(), BRIN_elog, brin_page_init(), BRIN_PAGETYPE_REGULAR, BufferGetBlockNumber(), BufferGetPage(), DEBUG2, END_CRIT_SECTION, log_newpage_buffer(), MarkBufferDirty(), RecordPageWithFreeSpace(), and START_CRIT_SECTION.
Referenced by brin_doupdate(), brin_getinsertbuffer(), and brin_page_cleanup().
void brin_metapage_init | ( | Page | page, |
BlockNumber | pagesPerRange, | ||
uint16 | version | ||
) |
Definition at line 486 of file brin_pageops.c.
References BRIN_META_MAGIC, brin_page_init(), BRIN_PAGETYPE_META, BrinMetaPageData::brinMagic, BrinMetaPageData::brinVersion, BrinMetaPageData::lastRevmapPage, PageGetContents(), and BrinMetaPageData::pagesPerRange.
Referenced by brin_xlog_createidx(), brinbuild(), and brinbuildempty().
Definition at line 624 of file brin_pageops.c.
References br_page_get_freespace(), brin_initialize_empty_new_buffer(), BRIN_IS_META_PAGE, BRIN_IS_REVMAP_PAGE, buf, BUFFER_LOCK_EXCLUSIVE, BUFFER_LOCK_UNLOCK, BufferGetBlockNumber(), BufferGetPage(), LockBuffer(), LockRelationForExtension(), PageIsNew(), RecordPageWithFreeSpace(), ShareLock, and UnlockRelationForExtension().
Referenced by brin_vacuum_scan().
Definition at line 475 of file brin_pageops.c.
References BrinPageType, PageInit(), and type.
Referenced by brin_doinsert(), brin_doupdate(), brin_initialize_empty_new_buffer(), brin_metapage_init(), brin_xlog_insert_update(), brin_xlog_revmap_extend(), and revmap_physical_extend().
Definition at line 524 of file brin_pageops.c.
References BRIN_EVACUATE_PAGE, BrinPageFlags, buf, BufferGetPage(), FirstOffsetNumber, ItemIdIsUsed, MarkBufferDirtyHint(), PageGetItemId(), PageGetMaxOffsetNumber(), and PageIsNew().
Referenced by revmap_physical_extend().