|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <limits.h>#include <math.h>#include "access/brin.h"#include "access/brin_internal.h"#include "access/brin_page.h"#include "access/brin_tuple.h"#include "access/genam.h"#include "access/htup_details.h"#include "access/reloptions.h"#include "catalog/pg_am.h"#include "catalog/pg_type.h"#include "common/hashfn.h"#include "port/pg_bitutils.h"#include "utils/fmgrprotos.h"#include "utils/rel.h"
Go to the source code of this file.
Data Structures | |
| struct | BloomOptions |
| struct | BloomFilter |
| struct | BloomOpaque |
Macros | |
| #define | BloomEqualStrategyNumber 1 |
| #define | BLOOM_MAX_PROCNUMS 1 /* maximum support procs we need */ |
| #define | PROCNUM_HASH 11 /* required */ |
| #define | PROCNUM_BASE 11 |
| #define | BLOOM_MIN_NDISTINCT_PER_RANGE 16 |
| #define | BLOOM_DEFAULT_NDISTINCT_PER_RANGE -0.1 /* 10% of values */ |
| #define | BLOOM_MIN_FALSE_POSITIVE_RATE 0.0001 /* 0.01% fp rate */ |
| #define | BLOOM_MAX_FALSE_POSITIVE_RATE 0.25 /* 25% fp rate */ |
| #define | BLOOM_DEFAULT_FALSE_POSITIVE_RATE 0.01 /* 1% fp rate */ |
| #define | BloomGetNDistinctPerRange(opts) |
| #define | BloomGetFalsePositiveRate(opts) |
| #define | BloomMaxFilterSize |
| #define | BLOOM_SEED_1 0x71d924af |
| #define | BLOOM_SEED_2 0xba48b314 |
Typedefs | |
| typedef struct BloomOptions | BloomOptions |
| typedef struct BloomFilter | BloomFilter |
| typedef struct BloomOpaque | BloomOpaque |
Definition at line 195 of file brin_bloom.c.
Definition at line 177 of file brin_bloom.c.
Definition at line 194 of file brin_bloom.c.
Definition at line 143 of file brin_bloom.c.
Definition at line 193 of file brin_bloom.c.
| #define BLOOM_MIN_NDISTINCT_PER_RANGE 16 |
Definition at line 170 of file brin_bloom.c.
| #define BLOOM_SEED_1 0x71d924af |
Definition at line 223 of file brin_bloom.c.
| #define BLOOM_SEED_2 0xba48b314 |
Definition at line 224 of file brin_bloom.c.
| #define BloomEqualStrategyNumber 1 |
Definition at line 134 of file brin_bloom.c.
Definition at line 202 of file brin_bloom.c.
Definition at line 197 of file brin_bloom.c.
| #define BloomMaxFilterSize |
Definition at line 212 of file brin_bloom.c.
| #define PROCNUM_BASE 11 |
Definition at line 150 of file brin_bloom.c.
| #define PROCNUM_HASH 11 /* required */ |
Definition at line 144 of file brin_bloom.c.
|
static |
Definition at line 371 of file brin_bloom.c.
References bit(), BLOOM_SEED_1, BLOOM_SEED_2, BloomFilter::data, fb(), hash_bytes_uint32_extended(), i, BloomFilter::nbits, BloomFilter::nbits_set, BloomFilter::nhashes, and value.
Referenced by brin_bloom_add_value().
|
static |
Definition at line 408 of file brin_bloom.c.
References bit(), BLOOM_SEED_1, BLOOM_SEED_2, BloomFilter::data, fb(), hash_bytes_uint32_extended(), i, BloomFilter::nbits, BloomFilter::nhashes, and value.
Referenced by brin_bloom_consistent().
|
static |
Definition at line 272 of file brin_bloom.c.
References fb().
Referenced by bloom_init().
Definition at line 718 of file brin_bloom.c.
References ereport, errcode(), errdetail_internal(), errmsg_internal(), ERROR, BloomOpaque::extra_procinfos, fb(), fmgr_info_copy(), FmgrInfo::fn_oid, index_getprocid(), index_getprocinfo(), InvalidOid, PROCNUM_BASE, and RegProcedureIsValid.
Referenced by brin_bloom_add_value(), and brin_bloom_consistent().
|
static |
Definition at line 311 of file brin_bloom.c.
References Assert, bloom_filter_size(), BloomMaxFilterSize, data, elog, ERROR, fb(), BloomFilter::flags, len, BloomFilter::nbits, BloomFilter::nhashes, palloc0(), and SET_VARSIZE().
Referenced by brin_bloom_add_value().
| Datum brin_bloom_add_value | ( | PG_FUNCTION_ARGS | ) |
Definition at line 540 of file brin_bloom.c.
References Assert, bloom_add_value(), bloom_get_procinfo(), bloom_init(), BloomGetFalsePositiveRate, brin_bloom_get_ndistinct(), DatumGetUInt32(), fb(), FunctionCall1Coll(), newval, opts, PG_DETOAST_DATUM, PG_GET_COLLATION, PG_GET_OPCLASS_OPTIONS, PG_GETARG_BOOL, PG_GETARG_DATUM, PG_GETARG_POINTER, PG_RETURN_BOOL, PG_USED_FOR_ASSERTS_ONLY, PointerGetDatum(), and PROCNUM_HASH.
| Datum brin_bloom_consistent | ( | PG_FUNCTION_ARGS | ) |
Definition at line 595 of file brin_bloom.c.
References Assert, bloom_contains_value(), bloom_get_procinfo(), BloomEqualStrategyNumber, DatumGetUInt32(), elog, ERROR, fb(), FunctionCall1Coll(), PG_DETOAST_DATUM, PG_GET_COLLATION, PG_GETARG_INT32, PG_GETARG_POINTER, PG_RETURN_BOOL, PROCNUM_HASH, SK_ISNULL, and value.
|
static |
Definition at line 497 of file brin_bloom.c.
References Assert, BlockNumberIsValid(), BLOOM_MIN_NDISTINCT_PER_RANGE, BloomGetNDistinctPerRange, BrinGetPagesPerRange, fb(), Max, MaxHeapTuplesPerPage, Min, and opts.
Referenced by brin_bloom_add_value().
| Datum brin_bloom_opcinfo | ( | PG_FUNCTION_ARGS | ) |
Definition at line 450 of file brin_bloom.c.
References fb(), lookup_type_cache(), MAXALIGN, BrinOpcInfo::oi_nstored, BrinOpcInfo::oi_opaque, BrinOpcInfo::oi_regular_nulls, BrinOpcInfo::oi_typcache, palloc0(), PG_RETURN_POINTER, and SizeofBrinOpcInfo.
| Datum brin_bloom_options | ( | PG_FUNCTION_ARGS | ) |
Definition at line 748 of file brin_bloom.c.
References add_local_real_reloption(), BLOOM_DEFAULT_FALSE_POSITIVE_RATE, BLOOM_DEFAULT_NDISTINCT_PER_RANGE, BLOOM_MAX_FALSE_POSITIVE_RATE, BLOOM_MIN_FALSE_POSITIVE_RATE, fb(), init_local_reloptions(), PG_GETARG_POINTER, and PG_RETURN_VOID.
| Datum brin_bloom_summary_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 778 of file brin_bloom.c.
References ereport, errcode(), errmsg(), ERROR, fb(), and PG_RETURN_VOID.
| Datum brin_bloom_summary_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 800 of file brin_bloom.c.
References appendStringInfo(), appendStringInfoChar(), initStringInfo(), BloomFilter::nbits, BloomFilter::nbits_set, BloomFilter::nhashes, PG_DETOAST_DATUM, PG_GETARG_DATUM, PG_RETURN_CSTRING, and str.
| Datum brin_bloom_summary_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 824 of file brin_bloom.c.
References ereport, errcode(), errmsg(), ERROR, fb(), and PG_RETURN_VOID.
| Datum brin_bloom_summary_send | ( | PG_FUNCTION_ARGS | ) |
| Datum brin_bloom_union | ( | PG_FUNCTION_ARGS | ) |
Definition at line 667 of file brin_bloom.c.
References Assert, DatumGetPointer(), fb(), i, pfree(), PG_DETOAST_DATUM, PG_GETARG_POINTER, pg_popcount(), PG_RETURN_VOID, and PointerGetDatum().