PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | TBMIterateResult |
Typedefs | |
typedef struct TIDBitmap | TIDBitmap |
typedef struct TBMIterator | TBMIterator |
typedef struct TBMSharedIterator | TBMSharedIterator |
typedef struct TBMIterateResult | TBMIterateResult |
Functions | |
TIDBitmap * | tbm_create (long maxbytes, dsa_area *dsa) |
void | tbm_free (TIDBitmap *tbm) |
void | tbm_free_shared_area (dsa_area *dsa, dsa_pointer dp) |
void | tbm_add_tuples (TIDBitmap *tbm, const ItemPointer tids, int ntids, bool recheck) |
void | tbm_add_page (TIDBitmap *tbm, BlockNumber pageno) |
void | tbm_union (TIDBitmap *a, const TIDBitmap *b) |
void | tbm_intersect (TIDBitmap *a, const TIDBitmap *b) |
bool | tbm_is_empty (const TIDBitmap *tbm) |
TBMIterator * | tbm_begin_iterate (TIDBitmap *tbm) |
dsa_pointer | tbm_prepare_shared_iterate (TIDBitmap *tbm) |
TBMIterateResult * | tbm_iterate (TBMIterator *iterator) |
TBMIterateResult * | tbm_shared_iterate (TBMSharedIterator *iterator) |
void | tbm_end_iterate (TBMIterator *iterator) |
void | tbm_end_shared_iterate (TBMSharedIterator *iterator) |
TBMSharedIterator * | tbm_attach_shared_iterate (dsa_area *dsa, dsa_pointer dp) |
long | tbm_calculate_entries (double maxbytes) |
typedef struct TBMIterateResult TBMIterateResult |
typedef struct TBMIterator TBMIterator |
Definition at line 1 of file tidbitmap.h.
typedef struct TBMSharedIterator TBMSharedIterator |
Definition at line 1 of file tidbitmap.h.
Definition at line 1 of file tidbitmap.h.
void tbm_add_page | ( | TIDBitmap * | tbm, |
BlockNumber | pageno | ||
) |
Definition at line 443 of file tidbitmap.c.
References TIDBitmap::maxentries, TIDBitmap::nentries, tbm_lossify(), and tbm_mark_page_lossy().
Referenced by bringetbitmap(), and gingetbitmap().
void tbm_add_tuples | ( | TIDBitmap * | tbm, |
const ItemPointer | tids, | ||
int | ntids, | ||
bool | recheck | ||
) |
Definition at line 377 of file tidbitmap.c.
References Assert, BITNUM, elog, ERROR, i, InvalidBlockNumber, PagetableEntry::ischunk, ItemPointerGetBlockNumber(), ItemPointerGetOffsetNumber(), TIDBitmap::iterating, MAX_TUPLES_PER_PAGE, TIDBitmap::maxentries, TIDBitmap::nentries, PagetableEntry::recheck, tbm_get_pageentry(), tbm_lossify(), TBM_NOT_ITERATING, tbm_page_is_lossy(), WORDNUM, and PagetableEntry::words.
Referenced by blgetbitmap(), btgetbitmap(), collectMatchBitmap(), GinDataLeafPageGetItemsToTbm(), gingetbitmap(), ginPostingListDecodeAllSegmentsToTbm(), gistScanPage(), hashgetbitmap(), scanPendingInsert(), and storeBitmap().
TBMSharedIterator* tbm_attach_shared_iterate | ( | dsa_area * | dsa, |
dsa_pointer | dp | ||
) |
Definition at line 1461 of file tidbitmap.c.
References dsa_get_address(), MAX_TUPLES_PER_PAGE, TBMSharedIteratorState::nchunks, TBMSharedIteratorState::npages, TBMSharedIteratorState::pagetable, palloc0(), TBMSharedIterator::ptbase, TBMSharedIterator::ptchunks, TBMSharedIterator::ptpages, TBMSharedIteratorState::schunks, TBMSharedIteratorState::spages, and TBMSharedIterator::state.
Referenced by BitmapHeapNext().
TBMIterator* tbm_begin_iterate | ( | TIDBitmap * | tbm | ) |
Definition at line 689 of file tidbitmap.c.
References Assert, i, PagetableEntry::ischunk, TIDBitmap::iterating, MAX_TUPLES_PER_PAGE, TIDBitmap::mcxt, MemoryContextAlloc(), TIDBitmap::nchunks, TIDBitmap::npages, TIDBitmap::pagetable, palloc(), qsort, TBMIterator::schunkbit, TBMIterator::schunkptr, TIDBitmap::schunks, TBMIterator::spageptr, TIDBitmap::spages, TIDBitmap::status, TBMIterator::tbm, tbm_comparator(), TBM_HASH, TBM_ITERATING_PRIVATE, TBM_ITERATING_SHARED, and TBM_NOT_ITERATING.
Referenced by BitmapHeapNext(), and startScanEntry().
long tbm_calculate_entries | ( | double | maxbytes | ) |
Definition at line 1542 of file tidbitmap.c.
Referenced by compute_bitmap_pages(), and tbm_create().
Definition at line 266 of file tidbitmap.c.
References CurrentMemoryContext, TIDBitmap::dsa, TIDBitmap::dsapagetable, TIDBitmap::dsapagetableold, InvalidDsaPointer, TIDBitmap::lossify_start, makeNode, TIDBitmap::maxentries, TIDBitmap::mcxt, TIDBitmap::ptchunks, TIDBitmap::ptpages, TIDBitmap::status, tbm_calculate_entries(), and TBM_EMPTY.
Referenced by collectMatchBitmap(), MultiExecBitmapIndexScan(), and MultiExecBitmapOr().
void tbm_end_iterate | ( | TBMIterator * | iterator | ) |
Definition at line 1146 of file tidbitmap.c.
References pfree().
Referenced by BitmapPrefetch(), entryGetItem(), ExecEndBitmapHeapScan(), ExecReScanBitmapHeapScan(), ginFreeScanKeys(), and startScanEntry().
void tbm_end_shared_iterate | ( | TBMSharedIterator * | iterator | ) |
Definition at line 1158 of file tidbitmap.c.
References pfree().
Referenced by BitmapPrefetch(), ExecEndBitmapHeapScan(), and ExecReScanBitmapHeapScan().
void tbm_free | ( | TIDBitmap * | tbm | ) |
Definition at line 322 of file tidbitmap.c.
References TIDBitmap::pagetable, pfree(), TIDBitmap::schunks, and TIDBitmap::spages.
Referenced by ExecEndBitmapHeapScan(), ExecReScanBitmapHeapScan(), ginFreeScanKeys(), MultiExecBitmapAnd(), MultiExecBitmapOr(), and startScanEntry().
void tbm_free_shared_area | ( | dsa_area * | dsa, |
dsa_pointer | dp | ||
) |
Definition at line 341 of file tidbitmap.c.
References dsa_free(), dsa_get_address(), DsaPointerIsValid, TBMSharedIteratorState::pagetable, pg_atomic_sub_fetch_u32(), PTEntryArray::refcount, PTIterationArray::refcount, TBMSharedIteratorState::schunks, and TBMSharedIteratorState::spages.
Referenced by ExecBitmapHeapReInitializeDSM().
Definition at line 540 of file tidbitmap.c.
References a, Assert, b, PagetableEntry::blockno, elog, ERROR, i, PagetableEntry::ischunk, TBM_EMPTY, TBM_HASH, tbm_intersect_page(), and TBM_ONE_PAGE.
Referenced by MultiExecBitmapAnd().
Definition at line 670 of file tidbitmap.c.
References TIDBitmap::nentries.
Referenced by MultiExecBitmapAnd(), and startScanEntry().
TBMIterateResult* tbm_iterate | ( | TBMIterator * | iterator | ) |
Definition at line 971 of file tidbitmap.c.
References Assert, PagetableEntry::blockno, chunk, TIDBitmap::entry1, TIDBitmap::iterating, TIDBitmap::nchunks, TIDBitmap::npages, TBMIterator::output, output, PAGES_PER_CHUNK, PagetableEntry::recheck, TBMIterator::schunkbit, TBMIterator::schunkptr, TIDBitmap::schunks, TBMIterator::spageptr, TIDBitmap::spages, TIDBitmap::status, TBMIterator::tbm, tbm_advance_schunkbit(), tbm_extract_page_tuple(), TBM_ITERATING_PRIVATE, and TBM_ONE_PAGE.
Referenced by BitmapAdjustPrefetchIterator(), BitmapPrefetch(), entryGetItem(), and heapam_scan_bitmap_next_block().
dsa_pointer tbm_prepare_shared_iterate | ( | TIDBitmap * | tbm | ) |
Definition at line 766 of file tidbitmap.c.
References Assert, TIDBitmap::dsa, dsa_allocate, dsa_allocate0, dsa_get_address(), TIDBitmap::dsapagetable, TIDBitmap::entry1, i, idx(), PTIterationArray::index, PagetableEntry::ischunk, TIDBitmap::iterating, TBMSharedIteratorState::lock, LWLockInitialize(), LWTRANCHE_SHARED_TIDBITMAP, TIDBitmap::maxentries, TBMSharedIteratorState::maxentries, TIDBitmap::nchunks, TBMSharedIteratorState::nchunks, TIDBitmap::nentries, TBMSharedIteratorState::nentries, TIDBitmap::npages, TBMSharedIteratorState::npages, TIDBitmap::pagetable, TBMSharedIteratorState::pagetable, pg_atomic_add_fetch_u32(), pg_atomic_init_u32(), TIDBitmap::ptchunks, PTEntryArray::ptentry, TIDBitmap::ptpages, qsort_arg(), PTEntryArray::refcount, PTIterationArray::refcount, TBMSharedIteratorState::schunkbit, TBMSharedIteratorState::schunkptr, TBMSharedIteratorState::schunks, TBMSharedIteratorState::spageptr, TBMSharedIteratorState::spages, TIDBitmap::status, TBM_HASH, TBM_ITERATING_PRIVATE, TBM_ITERATING_SHARED, TBM_NOT_ITERATING, TBM_ONE_PAGE, and tbm_shared_comparator().
Referenced by BitmapHeapNext().
TBMIterateResult* tbm_shared_iterate | ( | TBMSharedIterator * | iterator | ) |
Definition at line 1052 of file tidbitmap.c.
References PagetableEntry::blockno, chunk, PTIterationArray::index, TBMSharedIteratorState::lock, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), TBMSharedIteratorState::nchunks, TBMSharedIteratorState::npages, TBMSharedIterator::output, output, PAGES_PER_CHUNK, TBMSharedIterator::ptbase, TBMSharedIterator::ptchunks, PTEntryArray::ptentry, TBMSharedIterator::ptpages, PagetableEntry::recheck, TBMSharedIteratorState::schunkbit, TBMSharedIteratorState::schunkptr, TBMSharedIteratorState::spageptr, TBMSharedIterator::state, tbm_advance_schunkbit(), and tbm_extract_page_tuple().
Referenced by BitmapAdjustPrefetchIterator(), BitmapPrefetch(), and heapam_scan_bitmap_next_block().
Definition at line 458 of file tidbitmap.c.
References a, Assert, b, i, TBM_HASH, TBM_ONE_PAGE, and tbm_union_page().
Referenced by MultiExecBitmapOr().