PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | BlockSamplerData |
struct | ReservoirStateData |
Typedefs | |
typedef BlockSamplerData * | BlockSampler |
typedef ReservoirStateData * | ReservoirState |
Functions | |
void | sampler_random_init_state (uint32 seed, pg_prng_state *randstate) |
double | sampler_random_fract (pg_prng_state *randstate) |
BlockNumber | BlockSampler_Init (BlockSampler bs, BlockNumber nblocks, int samplesize, uint32 randseed) |
bool | BlockSampler_HasMore (BlockSampler bs) |
BlockNumber | BlockSampler_Next (BlockSampler bs) |
void | reservoir_init_selection_state (ReservoirState rs, int n) |
double | reservoir_get_next_S (ReservoirState rs, double t, int n) |
double | anl_random_fract (void) |
double | anl_init_selection_state (int n) |
double | anl_get_next_S (double t, int n, double *stateptr) |
typedef BlockSamplerData* BlockSampler |
Definition at line 37 of file sampling.h.
typedef ReservoirStateData* ReservoirState |
Definition at line 52 of file sampling.h.
double anl_get_next_S | ( | double | t, |
int | n, | ||
double * | stateptr | ||
) |
Definition at line 296 of file sampling.c.
References oldrs, reservoir_get_next_S(), and ReservoirStateData::W.
double anl_init_selection_state | ( | int | n | ) |
Definition at line 281 of file sampling.c.
References oldrs, oldrs_initialized, pg_global_prng_state, pg_prng_uint32(), ReservoirStateData::randstate, sampler_random_fract(), sampler_random_init_state(), and unlikely.
double anl_random_fract | ( | void | ) |
Definition at line 266 of file sampling.c.
References oldrs, oldrs_initialized, pg_global_prng_state, pg_prng_uint32(), ReservoirStateData::randstate, sampler_random_fract(), sampler_random_init_state(), and unlikely.
bool BlockSampler_HasMore | ( | BlockSampler | bs | ) |
Definition at line 58 of file sampling.c.
References BlockSamplerData::m, BlockSamplerData::N, BlockSamplerData::n, and BlockSamplerData::t.
Referenced by block_sampling_read_stream_next(), and BlockSampler_Next().
BlockNumber BlockSampler_Init | ( | BlockSampler | bs, |
BlockNumber | nblocks, | ||
int | samplesize, | ||
uint32 | randseed | ||
) |
Definition at line 39 of file sampling.c.
References BlockSamplerData::m, Min, BlockSamplerData::N, BlockSamplerData::n, BlockSamplerData::randstate, sampler_random_init_state(), and BlockSamplerData::t.
Referenced by acquire_sample_rows().
BlockNumber BlockSampler_Next | ( | BlockSampler | bs | ) |
Definition at line 64 of file sampling.c.
References Assert, BlockSampler_HasMore(), K, BlockSamplerData::m, BlockSamplerData::N, BlockSamplerData::n, BlockSamplerData::randstate, sampler_random_fract(), and BlockSamplerData::t.
Referenced by block_sampling_read_stream_next().
double reservoir_get_next_S | ( | ReservoirState | rs, |
double | t, | ||
int | n | ||
) |
Definition at line 147 of file sampling.c.
References ReservoirStateData::randstate, S, sampler_random_fract(), W, ReservoirStateData::W, and y.
Referenced by acquire_sample_rows(), analyze_row_processor(), anl_get_next_S(), and file_acquire_sample_rows().
void reservoir_init_selection_state | ( | ReservoirState | rs, |
int | n | ||
) |
Definition at line 133 of file sampling.c.
References pg_global_prng_state, pg_prng_uint32(), ReservoirStateData::randstate, sampler_random_fract(), sampler_random_init_state(), and ReservoirStateData::W.
Referenced by acquire_sample_rows(), file_acquire_sample_rows(), and postgresAcquireSampleRowsFunc().
double sampler_random_fract | ( | pg_prng_state * | randstate | ) |
Definition at line 241 of file sampling.c.
References pg_prng_double(), res, and unlikely.
Referenced by acquire_sample_rows(), analyze_row_processor(), anl_init_selection_state(), anl_random_fract(), BlockSampler_Next(), file_acquire_sample_rows(), random_relative_prime(), reservoir_get_next_S(), reservoir_init_selection_state(), system_rows_nextsampleblock(), and system_time_nextsampleblock().
void sampler_random_init_state | ( | uint32 | seed, |
pg_prng_state * | randstate | ||
) |
Definition at line 234 of file sampling.c.
References pg_prng_seed().
Referenced by anl_init_selection_state(), anl_random_fract(), BlockSampler_Init(), reservoir_init_selection_state(), system_rows_nextsampleblock(), and system_time_nextsampleblock().