1/*-------------------------------------------------------------------------
4 * Bloom index scan functions.
6 * Copyright (c) 2016-2025, PostgreSQL Global Development Group
9 * contrib/bloom/blscan.c
11 *-------------------------------------------------------------------------
22 * Begin scan of bloom index.
42 * Rescan a bloom index.
46 ScanKey orderbys,
int norderbys)
59 * End scan of bloom index.
72 * Insert all matching tuples into a bitmap.
86 /* New search: have to calculate search signature */
94 * Assume bloom-indexable operators to be strict, so nothing could
95 * be found for NULL key.
104 /* Add next value to the signature */
113 * We're going to read the whole index. This is why we use appropriate
114 * buffer access strategy.
138 for (offset = 1; offset <= maxOffset; offset++)
143 /* Check index signature with scan signature */
153 /* Add matching tuples to bitmap */
#define BloomPageGetMaxOffset(page)
#define BloomPageGetTuple(state, page, offset)
uint16 BloomSignatureWord
void signValue(BloomState *state, BloomSignatureWord *sign, Datum value, int attno)
#define BloomPageIsDeleted(page)
void initBloomState(BloomState *state, Relation index)
BloomScanOpaqueData * BloomScanOpaque
int64 blgetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
IndexScanDesc blbeginscan(Relation r, int nkeys, int norderbys)
void blendscan(IndexScanDesc scan)
void blrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys, ScanKey orderbys, int norderbys)
void UnlockReleaseBuffer(Buffer buffer)
void LockBuffer(Buffer buffer, int mode)
Buffer ReadBufferExtended(Relation reln, ForkNumber forkNum, BlockNumber blockNum, ReadBufferMode mode, BufferAccessStrategy strategy)
#define BUFFER_LOCK_SHARE
#define RelationGetNumberOfBlocks(reln)
static Page BufferGetPage(Buffer buffer)
static bool PageIsNew(const PageData *page)
BufferAccessStrategy GetAccessStrategy(BufferAccessStrategyType btype)
void FreeAccessStrategy(BufferAccessStrategy strategy)
IndexScanDesc RelationGetIndexScan(Relation indexRelation, int nkeys, int norderbys)
if(TABLE==NULL||TABLE_index==NULL)
void pfree(void *pointer)
void * palloc0(Size size)
#define CHECK_FOR_INTERRUPTS()
#define pgstat_count_index_scan(rel)
BloomSignatureWord * sign
BloomSignatureWord sign[FLEXIBLE_ARRAY_MEMBER]
struct ScanKeyData * keyData
struct IndexScanInstrumentation * instrument
void tbm_add_tuples(TIDBitmap *tbm, const ItemPointer tids, int ntids, bool recheck)