PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <math.h>
#include "access/tsmapi.h"
#include "catalog/pg_type.h"
#include "miscadmin.h"
#include "optimizer/optimizer.h"
#include "utils/sampling.h"
#include "utils/spccache.h"
Go to the source code of this file.
Data Structures | |
struct | SystemTimeSamplerData |
Functions | |
PG_FUNCTION_INFO_V1 (tsm_system_time_handler) | |
static void | system_time_samplescangetsamplesize (PlannerInfo *root, RelOptInfo *baserel, List *paramexprs, BlockNumber *pages, double *tuples) |
static void | system_time_initsamplescan (SampleScanState *node, int eflags) |
static void | system_time_beginsamplescan (SampleScanState *node, Datum *params, int nparams, uint32 seed) |
static BlockNumber | system_time_nextsampleblock (SampleScanState *node, BlockNumber nblocks) |
static OffsetNumber | system_time_nextsampletuple (SampleScanState *node, BlockNumber blockno, OffsetNumber maxoffset) |
static uint32 | random_relative_prime (uint32 n, pg_prng_state *randstate) |
Datum | tsm_system_time_handler (PG_FUNCTION_ARGS) |
static uint32 | gcd (uint32 a, uint32 b) |
Variables | |
PG_MODULE_MAGIC | |
PG_FUNCTION_INFO_V1 | ( | tsm_system_time_handler | ) |
|
static |
Definition at line 332 of file tsm_system_time.c.
References CHECK_FOR_INTERRUPTS, gcd(), and sampler_random_fract().
Referenced by system_time_nextsampleblock().
|
static |
Definition at line 187 of file tsm_system_time.c.
References DatumGetFloat8(), SystemTimeSamplerData::doneblocks, ereport, errcode(), errmsg(), ERROR, InvalidOffsetNumber, SystemTimeSamplerData::lt, SystemTimeSamplerData::millis, SystemTimeSamplerData::seed, and SampleScanState::tsm_state.
Referenced by tsm_system_time_handler().
|
static |
Definition at line 177 of file tsm_system_time.c.
References palloc0(), and SampleScanState::tsm_state.
Referenced by tsm_system_time_handler().
|
static |
Definition at line 214 of file tsm_system_time.c.
References SystemTimeSamplerData::doneblocks, SystemTimeSamplerData::firstblock, if(), INSTR_TIME_GET_MILLISEC, INSTR_TIME_SET_CURRENT, INSTR_TIME_SUBTRACT, InvalidBlockNumber, SystemTimeSamplerData::lb, SystemTimeSamplerData::millis, SystemTimeSamplerData::nblocks, random_relative_prime(), sampler_random_fract(), sampler_random_init_state(), SystemTimeSamplerData::seed, SystemTimeSamplerData::start_time, SystemTimeSamplerData::step, and SampleScanState::tsm_state.
Referenced by tsm_system_time_handler().
|
static |
Definition at line 287 of file tsm_system_time.c.
References FirstOffsetNumber, if(), InvalidOffsetNumber, SystemTimeSamplerData::lt, and SampleScanState::tsm_state.
Referenced by tsm_system_time_handler().
|
static |
Definition at line 102 of file tsm_system_time.c.
References clamp_row_est(), DatumGetFloat8(), estimate_expression_value(), get_tablespace_page_costs(), IsA, linitial, Min, RelOptInfo::pages, RelOptInfo::reltablespace, root, and RelOptInfo::tuples.
Referenced by tsm_system_time_handler().
Datum tsm_system_time_handler | ( | PG_FUNCTION_ARGS | ) |
Definition at line 78 of file tsm_system_time.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_time_beginsamplescan(), system_time_initsamplescan(), system_time_nextsampleblock(), system_time_nextsampletuple(), and system_time_samplescangetsamplesize().
PG_MODULE_MAGIC |
Definition at line 36 of file tsm_system_time.c.