PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <math.h>
#include "access/tsmapi.h"
#include "catalog/pg_type.h"
#include "common/hashfn.h"
#include "optimizer/optimizer.h"
#include "utils/fmgrprotos.h"
Go to the source code of this file.
Data Structures | |
struct | BernoulliSamplerData |
Functions | |
static void | bernoulli_samplescangetsamplesize (PlannerInfo *root, RelOptInfo *baserel, List *paramexprs, BlockNumber *pages, double *tuples) |
static void | bernoulli_initsamplescan (SampleScanState *node, int eflags) |
static void | bernoulli_beginsamplescan (SampleScanState *node, Datum *params, int nparams, uint32 seed) |
static OffsetNumber | bernoulli_nextsampletuple (SampleScanState *node, BlockNumber blockno, OffsetNumber maxoffset) |
Datum | tsm_bernoulli_handler (PG_FUNCTION_ARGS) |
|
static |
Definition at line 136 of file bernoulli.c.
References BernoulliSamplerData::cutoff, DatumGetFloat4(), ereport, errcode(), errmsg(), ERROR, InvalidOffsetNumber, BernoulliSamplerData::lt, PG_UINT32_MAX, BernoulliSamplerData::seed, SampleScanState::tsm_state, SampleScanState::use_bulkread, and SampleScanState::use_pagemode.
Referenced by tsm_bernoulli_handler().
|
static |
Definition at line 127 of file bernoulli.c.
References palloc0(), and SampleScanState::tsm_state.
Referenced by tsm_bernoulli_handler().
|
static |
Definition at line 181 of file bernoulli.c.
References DatumGetUInt32(), FirstOffsetNumber, hash(), hash_any(), if(), InvalidOffsetNumber, BernoulliSamplerData::lt, BernoulliSamplerData::seed, and SampleScanState::tsm_state.
Referenced by tsm_bernoulli_handler().
|
static |
Definition at line 86 of file bernoulli.c.
References clamp_row_est(), DatumGetFloat4(), estimate_expression_value(), IsA, linitial, RelOptInfo::pages, root, and RelOptInfo::tuples.
Referenced by tsm_bernoulli_handler().
Datum tsm_bernoulli_handler | ( | PG_FUNCTION_ARGS | ) |
Definition at line 65 of file bernoulli.c.
References TsmRoutine::BeginSampleScan, bernoulli_beginsamplescan(), bernoulli_initsamplescan(), bernoulli_nextsampletuple(), bernoulli_samplescangetsamplesize(), TsmRoutine::EndSampleScan, TsmRoutine::InitSampleScan, list_make1_oid, makeNode, TsmRoutine::NextSampleBlock, TsmRoutine::NextSampleTuple, TsmRoutine::parameterTypes, PG_RETURN_POINTER, TsmRoutine::repeatable_across_queries, TsmRoutine::repeatable_across_scans, and TsmRoutine::SampleScanGetSampleSize.