38 int nmcelems,
float4 minfreq);
134 Datum *mcelems = NULL;
146 &vardata, &other, &varonleft))
153 if (vardata.
vartype != INT4ARRAYOID)
168 if (((
Const *) other)->constisnull)
178 if (query->
size == 0)
195 nullfrac = stats->stanullfrac;
224 memset(&sslot, 0,
sizeof(sslot));
228 mcelems, mcefreqs, nmcelems, minfreq);
231 selec *= (1.0 - nullfrac);
246 int nmcelems,
float4 minfreq)
260 searchres = (
Datum *) bsearch(&item->
val, mcelems, nmcelems,
268 selec = mcefreqs[searchres - mcelems];
313 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
void check_stack_depth(void)
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)