MCPcopy Create free account
hub / github.com/apache/cloudberry / PassByBloomFilter

Function PassByBloomFilter

src/backend/executor/nodeSeqscan.c:412–446  ·  view source on GitHub ↗

* Returns true if the element may be in the bloom filter. */

Source from the content-addressed store, hash-verified

410 * Returns true if the element may be in the bloom filter.
411 */
412bool
413PassByBloomFilter(PlanState *ps, List *filters, TupleTableSlot *slot)
414{
415 ScanKey sk;
416 Datum val;
417 bool isnull;
418 ListCell *lc;
419 bloom_filter *blm_filter;
420
421 /*
422 * Mark that the pushdown runtime filter is actually taking effect.
423 */
424 if (ps->instrument && !ps->instrument->prf_work && list_length(filters))
425 ps->instrument->prf_work = true;
426
427 foreach (lc, filters)
428 {
429 sk = lfirst(lc);
430 if (sk->sk_flags != SK_BLOOM_FILTER)
431 continue;
432
433 val = slot_getattr(slot, sk->sk_attno, &isnull);
434 if (isnull)
435 continue;
436
437 blm_filter = (bloom_filter *)DatumGetPointer(sk->sk_argument);
438 if (bloom_lacks_element(blm_filter, (unsigned char *)&val, sizeof(Datum)))
439 {
440 InstrCountFilteredPRF(ps, 1);
441 return false;
442 }
443 }
444
445 return true;
446}
447
448/*
449 * Convert the list of ScanKey to the array, and append an emtpy ScanKey as

Callers 2

ExecDynamicSeqScanFunction · 0.85
SeqNextFunction · 0.85

Calls 4

list_lengthFunction · 0.85
slot_getattrFunction · 0.85
bloom_lacks_elementFunction · 0.85
foreachFunction · 0.50

Tested by

no test coverage detected