23#include "utils/fmgrprotos.h"
37 int nmcelems,
float4 minfreq);
133 Datum *mcelems = NULL;
145 &vardata, &other, &varonleft))
152 if (vardata.
vartype != INT4ARRAYOID)
167 if (((
Const *) other)->constisnull)
177 if (query->
size == 0)
194 nullfrac = stats->stanullfrac;
223 memset(&sslot, 0,
sizeof(sslot));
227 mcelems, mcefreqs, nmcelems, minfreq);
230 selec *= (1.0 - nullfrac);
245 int nmcelems,
float4 minfreq)
259 searchres = (
Datum *) bsearch(&item->
val, mcelems, nmcelems,
267 selec = mcefreqs[searchres - mcelems];
312 elog(
ERROR,
"unrecognized int query item type: %u", item->
type);
#define DatumGetQueryTypeP(X)
static int compare_val_int4(const void *a, const void *b)
Datum _int_overlap_joinsel(PG_FUNCTION_ARGS)
static Selectivity int_query_opr_selec(ITEM *item, Datum *mcelems, float4 *mcefreqs, int nmcelems, float4 minfreq)
Datum _int_matchsel(PG_FUNCTION_ARGS)
PG_FUNCTION_INFO_V1(_int_overlap_sel)
Datum _int_contains_sel(PG_FUNCTION_ARGS)
Datum _int_contained_sel(PG_FUNCTION_ARGS)
Datum _int_contains_joinsel(PG_FUNCTION_ARGS)
Datum _int_overlap_sel(PG_FUNCTION_ARGS)
Datum _int_contained_joinsel(PG_FUNCTION_ARGS)
Datum arraycontsel(PG_FUNCTION_ARGS)
Datum arraycontjoinsel(PG_FUNCTION_ARGS)
#define Assert(condition)
#define PG_RETURN_FLOAT8(x)
#define DirectFunctionCall4(func, arg1, arg2, arg3, arg4)
#define PG_GETARG_POINTER(n)
#define PG_GETARG_DATUM(n)
#define PG_GETARG_INT32(n)
#define PG_RETURN_DATUM(x)
#define DirectFunctionCall5(func, arg1, arg2, arg3, arg4, arg5)
#define HeapTupleIsValid(tuple)
void free_attstatsslot(AttStatsSlot *sslot)
bool get_attstatsslot(AttStatsSlot *sslot, HeapTuple statstuple, int reqkind, Oid reqop, int flags)
#define ATTSTATSSLOT_NUMBERS
#define ATTSTATSSLOT_VALUES
#define IsA(nodeptr, _type_)
FormData_pg_statistic * Form_pg_statistic
static Datum ObjectIdGetDatum(Oid X)
static int32 DatumGetInt32(Datum X)
bool get_restriction_variable(PlannerInfo *root, List *args, int varRelid, VariableStatData *vardata, Node **other, bool *varonleft)
#define ReleaseVariableStats(vardata)
#define CLAMP_PROBABILITY(p)
void check_stack_depth(void)