118 !((
Const *) limitnode)->constisnull)
134 if (ntuples > baserel->
tuples)
135 ntuples = (int64) baserel->
tuples;
141 double density = baserel->
tuples / (double) baserel->
pages;
143 npages = ntuples / density;
182 (
errcode(ERRCODE_INVALID_TABLESAMPLE_ARGUMENT),
183 errmsg(
"sample size must not be negative")));
185 sampler->
seed = seed;
213 if (sampler->
step == 0)
255 sampler->
lb = ((uint64) sampler->
lb + sampler->
step) % sampler->
nblocks;
256 }
while (sampler->
lb >= nblocks);
289 if (tupoffset > maxoffset)
292 sampler->
lt = tupoffset;
337 }
while (r == 0 ||
gcd(r, n) > 1);
#define InvalidBlockNumber
Node * estimate_expression_value(PlannerInfo *root, Node *node)
double clamp_row_est(double nrows)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define PG_RETURN_POINTER(x)
if(TABLE==NULL||TABLE_index==NULL)
void * palloc0(Size size)
#define CHECK_FOR_INTERRUPTS()
#define IsA(nodeptr, _type_)
#define InvalidOffsetNumber
#define FirstOffsetNumber
#define list_make1_oid(x1)
static int64 DatumGetInt64(Datum X)
double sampler_random_fract(pg_prng_state *randstate)
void sampler_random_init_state(uint32 seed, pg_prng_state *randstate)
NextSampleTuple_function NextSampleTuple
bool repeatable_across_scans
EndSampleScan_function EndSampleScan
SampleScanGetSampleSize_function SampleScanGetSampleSize
BeginSampleScan_function BeginSampleScan
NextSampleBlock_function NextSampleBlock
InitSampleScan_function InitSampleScan
bool repeatable_across_queries
static void system_rows_samplescangetsamplesize(PlannerInfo *root, RelOptInfo *baserel, List *paramexprs, BlockNumber *pages, double *tuples)
PG_FUNCTION_INFO_V1(tsm_system_rows_handler)
static void system_rows_initsamplescan(SampleScanState *node, int eflags)
static uint32 random_relative_prime(uint32 n, pg_prng_state *randstate)
static BlockNumber system_rows_nextsampleblock(SampleScanState *node, BlockNumber nblocks)
static uint32 gcd(uint32 a, uint32 b)
static void system_rows_beginsamplescan(SampleScanState *node, Datum *params, int nparams, uint32 seed)
Datum tsm_system_rows_handler(PG_FUNCTION_ARGS)
static OffsetNumber system_rows_nextsampletuple(SampleScanState *node, BlockNumber blockno, OffsetNumber maxoffset)