PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/tsmapi.h"
#include "catalog/pg_type.h"
#include "miscadmin.h"
#include "optimizer/optimizer.h"
#include "utils/sampling.h"
Go to the source code of this file.
Data Structures | |
struct | SystemRowsSamplerData |
Functions | |
PG_FUNCTION_INFO_V1 (tsm_system_rows_handler) | |
static void | system_rows_samplescangetsamplesize (PlannerInfo *root, RelOptInfo *baserel, List *paramexprs, BlockNumber *pages, double *tuples) |
static void | system_rows_initsamplescan (SampleScanState *node, int eflags) |
static void | system_rows_beginsamplescan (SampleScanState *node, Datum *params, int nparams, uint32 seed) |
static BlockNumber | system_rows_nextsampleblock (SampleScanState *node, BlockNumber nblocks) |
static OffsetNumber | system_rows_nextsampletuple (SampleScanState *node, BlockNumber blockno, OffsetNumber maxoffset) |
static uint32 | random_relative_prime (uint32 n, pg_prng_state *randstate) |
Datum | tsm_system_rows_handler (PG_FUNCTION_ARGS) |
static uint32 | gcd (uint32 a, uint32 b) |
Variables | |
PG_MODULE_MAGIC | |
Definition at line 300 of file tsm_system_rows.c.
Referenced by int4lcm(), int8lcm(), and random_relative_prime().
PG_FUNCTION_INFO_V1 | ( | tsm_system_rows_handler | ) |
|
static |
Definition at line 319 of file tsm_system_rows.c.
References CHECK_FOR_INTERRUPTS, gcd(), and sampler_random_fract().
Referenced by system_rows_nextsampleblock().
|
static |
Definition at line 171 of file tsm_system_rows.c.
References DatumGetInt64(), SystemRowsSamplerData::doneblocks, ereport, errcode(), errmsg(), ERROR, InvalidOffsetNumber, SystemRowsSamplerData::lt, SystemRowsSamplerData::ntuples, SystemRowsSamplerData::seed, SampleScanState::tsm_state, and SampleScanState::use_pagemode.
Referenced by tsm_system_rows_handler().
|
static |
Definition at line 161 of file tsm_system_rows.c.
References palloc0(), and SampleScanState::tsm_state.
Referenced by tsm_system_rows_handler().
|
static |
Definition at line 204 of file tsm_system_rows.c.
References SystemRowsSamplerData::doneblocks, SampleScanState::donetuples, SystemRowsSamplerData::firstblock, if(), InvalidBlockNumber, SystemRowsSamplerData::lb, SystemRowsSamplerData::nblocks, SystemRowsSamplerData::ntuples, random_relative_prime(), sampler_random_fract(), sampler_random_init_state(), SystemRowsSamplerData::seed, SystemRowsSamplerData::step, and SampleScanState::tsm_state.
Referenced by tsm_system_rows_handler().
|
static |
Definition at line 270 of file tsm_system_rows.c.
References SampleScanState::donetuples, FirstOffsetNumber, if(), InvalidOffsetNumber, SystemRowsSamplerData::lt, SystemRowsSamplerData::ntuples, and SampleScanState::tsm_state.
Referenced by tsm_system_rows_handler().
|
static |
Definition at line 102 of file tsm_system_rows.c.
References clamp_row_est(), DatumGetInt64(), estimate_expression_value(), IsA, linitial, Min, RelOptInfo::pages, root, and RelOptInfo::tuples.
Referenced by tsm_system_rows_handler().
Datum tsm_system_rows_handler | ( | PG_FUNCTION_ARGS | ) |
Definition at line 78 of file tsm_system_rows.c.
References TsmRoutine::BeginSampleScan, 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, TsmRoutine::SampleScanGetSampleSize, system_rows_beginsamplescan(), system_rows_initsamplescan(), system_rows_nextsampleblock(), system_rows_nextsampletuple(), and system_rows_samplescangetsamplesize().
PG_MODULE_MAGIC |
Definition at line 37 of file tsm_system_rows.c.