PostgreSQL Source Code git master
|
#include "access/brin_tuple.h"
#include "storage/block.h"
#include "storage/buf.h"
#include "storage/itemptr.h"
#include "storage/off.h"
#include "utils/relcache.h"
#include "utils/snapshot.h"
Go to the source code of this file.
Typedefs | |
typedef struct BrinRevmap | BrinRevmap |
Functions | |
BrinRevmap * | brinRevmapInitialize (Relation idxrel, BlockNumber *pagesPerRange) |
void | brinRevmapTerminate (BrinRevmap *revmap) |
void | brinRevmapExtend (BrinRevmap *revmap, BlockNumber heapBlk) |
Buffer | brinLockRevmapPageForUpdate (BrinRevmap *revmap, BlockNumber heapBlk) |
void | brinSetHeapBlockItemptr (Buffer buf, BlockNumber pagesPerRange, BlockNumber heapBlk, ItemPointerData tid) |
BrinTuple * | brinGetTupleForHeapBlock (BrinRevmap *revmap, BlockNumber heapBlk, Buffer *buf, OffsetNumber *off, Size *size, int mode) |
bool | brinRevmapDesummarizeRange (Relation idxrel, BlockNumber heapBlk) |
typedef struct BrinRevmap BrinRevmap |
Definition at line 24 of file brin_revmap.h.
BrinTuple * brinGetTupleForHeapBlock | ( | BrinRevmap * | revmap, |
BlockNumber | heapBlk, | ||
Buffer * | buf, | ||
OffsetNumber * | off, | ||
Size * | size, | ||
int | mode | ||
) |
Definition at line 194 of file brin_revmap.c.
References Assert, BRIN_IS_REGULAR_PAGE, BrinTuple::bt_blkno, buf, BUFFER_LOCK_SHARE, BUFFER_LOCK_UNLOCK, BufferGetBlockNumber(), BufferGetPage(), BufferIsValid(), CHECK_FOR_INTERRUPTS, ereport, errcode(), errmsg_internal(), ERROR, HEAPBLK_TO_REVMAP_INDEX, InvalidBlockNumber, InvalidBuffer, InvalidOffsetNumber, ItemIdGetLength, ItemIdIsUsed, ItemPointerEquals(), ItemPointerGetBlockNumber(), ItemPointerGetOffsetNumber(), ItemPointerIsValid(), ItemPointerSetInvalid(), LockBuffer(), mode, PageGetContents(), PageGetItem(), PageGetItemId(), PageGetMaxOffsetNumber(), ReadBuffer(), ReleaseBuffer(), revmap_get_blkno(), BrinRevmap::rm_currBuf, BrinRevmap::rm_irel, BrinRevmap::rm_pagesPerRange, RevmapContents::rm_tids, and size.
Referenced by bringetbitmap(), brininsert(), brinsummarize(), and summarize_range().
Buffer brinLockRevmapPageForUpdate | ( | BrinRevmap * | revmap, |
BlockNumber | heapBlk | ||
) |
Definition at line 134 of file brin_revmap.c.
References BUFFER_LOCK_EXCLUSIVE, LockBuffer(), and revmap_get_buffer().
Referenced by brin_doinsert(), brin_doupdate(), and brinRevmapDesummarizeRange().
bool brinRevmapDesummarizeRange | ( | Relation | idxrel, |
BlockNumber | heapBlk | ||
) |
Definition at line 323 of file brin_revmap.c.
References BlockNumberIsValid(), BRIN_IS_REGULAR_PAGE, brinLockRevmapPageForUpdate(), brinRevmapInitialize(), brinRevmapTerminate(), brinSetHeapBlockItemptr(), BUFFER_LOCK_EXCLUSIVE, BUFFER_LOCK_UNLOCK, BufferGetPage(), END_CRIT_SECTION, ereport, errcode(), errmsg(), ERROR, xl_brin_desummarize::heapBlk, HEAPBLK_TO_REVMAP_INDEX, ItemIdIsUsed, ItemPointerGetBlockNumber(), ItemPointerGetOffsetNumber(), ItemPointerIsValid(), ItemPointerSetInvalid(), LockBuffer(), MarkBufferDirty(), PageGetContents(), PageGetItemId(), PageGetMaxOffsetNumber(), PageIndexTupleDeleteNoCompact(), PageSetLSN(), xl_brin_desummarize::pagesPerRange, ReadBuffer(), REGBUF_STANDARD, xl_brin_desummarize::regOffset, RelationNeedsWAL, revmap_get_blkno(), BrinRevmap::rm_pagesPerRange, RevmapContents::rm_tids, SizeOfBrinDesummarize, START_CRIT_SECTION, UnlockReleaseBuffer(), XLOG_BRIN_DESUMMARIZE, XLogBeginInsert(), XLogInsert(), XLogRegisterBuffer(), and XLogRegisterData().
Referenced by brin_desummarize_range().
void brinRevmapExtend | ( | BrinRevmap * | revmap, |
BlockNumber | heapBlk | ||
) |
Definition at line 112 of file brin_revmap.c.
References Assert, BRIN_METAPAGE_BLKNO, InvalidBlockNumber, PG_USED_FOR_ASSERTS_ONLY, and revmap_extend_and_get_blkno().
Referenced by brin_doinsert(), and brin_doupdate().
BrinRevmap * brinRevmapInitialize | ( | Relation | idxrel, |
BlockNumber * | pagesPerRange | ||
) |
Definition at line 70 of file brin_revmap.c.
References BRIN_METAPAGE_BLKNO, BUFFER_LOCK_SHARE, BUFFER_LOCK_UNLOCK, BufferGetPage(), InvalidBuffer, BrinMetaPageData::lastRevmapPage, LockBuffer(), PageGetContents(), BrinMetaPageData::pagesPerRange, palloc(), ReadBuffer(), BrinRevmap::rm_currBuf, BrinRevmap::rm_irel, BrinRevmap::rm_lastRevmapPage, BrinRevmap::rm_metaBuf, and BrinRevmap::rm_pagesPerRange.
Referenced by brinbeginscan(), brinbuild(), brinRevmapDesummarizeRange(), brinsummarize(), and initialize_brin_insertstate().
void brinRevmapTerminate | ( | BrinRevmap * | revmap | ) |
Definition at line 100 of file brin_revmap.c.
References InvalidBuffer, pfree(), ReleaseBuffer(), BrinRevmap::rm_currBuf, and BrinRevmap::rm_metaBuf.
Referenced by brinbuild(), brinendscan(), brininsertcleanup(), brinRevmapDesummarizeRange(), and brinsummarize().
void brinSetHeapBlockItemptr | ( | Buffer | buf, |
BlockNumber | pagesPerRange, | ||
BlockNumber | heapBlk, | ||
ItemPointerData | tid | ||
) |
Definition at line 155 of file brin_revmap.c.
References buf, BufferGetPage(), HEAPBLK_TO_REVMAP_INDEX, ItemPointerGetBlockNumber(), ItemPointerGetOffsetNumber(), ItemPointerIsValid(), ItemPointerSet(), ItemPointerSetInvalid(), PageGetContents(), and RevmapContents::rm_tids.
Referenced by brin_doinsert(), brin_doupdate(), brin_xlog_desummarize_page(), brin_xlog_insert_update(), and brinRevmapDesummarizeRange().