22#include "utils/fmgrprotos.h"
32#define DEFAULT_TS_MATCH_SEL 0.005
50 Datum *mcelem,
int nmcelem,
51 float4 *numbers,
int nnumbers);
56#define tsquery_opr_selec_no_stats(query) \
57 tsquery_opr_selec(GETQUERY(query), GETOPERAND(query), NULL, 0, 0)
86 &vardata, &other, &varonleft))
101 if (((
Const *) other)->constisnull)
112 if (((
Const *) other)->consttype == TSQUERYOID)
159 if (query->
size == 0)
191 selec *= (1.0 - stats->stanullfrac);
208 float4 *numbers,
int nnumbers)
223 if (nnumbers != nmcelem + 2)
230 for (
i = 0;
i < nmcelem;
i++)
245 minfreq = numbers[nnumbers - 2];
294 key.lexeme = operand +
oper->distance;
319 if (
lookup == NULL || length < 100)
322 matched = allmces = 0;
324 for (
i = 0;
i < length;
i++)
329 if (tlen >=
key.length &&
343 selec = matched + (1.0 - allmces) * ((
double) n_matched / length);
447 else if (len1 < len2)
#define Assert(condition)
#define PG_RETURN_FLOAT8(x)
#define PG_GETARG_POINTER(n)
#define PG_GETARG_INT32(n)
#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
void pfree(void *pointer)
#define IsA(nodeptr, _type_)
Operator oper(ParseState *pstate, List *opname, Oid ltypeId, Oid rtypeId, bool noError, int location)
FormData_pg_statistic * Form_pg_statistic
static Pointer DatumGetPointer(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)
#define tsquery_opr_selec_no_stats(query)
#define DEFAULT_TS_MATCH_SEL
Datum tsmatchjoinsel(PG_FUNCTION_ARGS)
static Selectivity tsquery_opr_selec(QueryItem *item, char *operand, TextFreq *lookup, int length, float4 minfreq)
static Selectivity tsquerysel(VariableStatData *vardata, Datum constval)
Datum tsmatchsel(PG_FUNCTION_ARGS)
static int compare_lexeme_textfreq(const void *e1, const void *e2)
static Selectivity mcelem_tsquery_selec(TSQuery query, Datum *mcelem, int nmcelem, float4 *numbers, int nnumbers)
static TSQuery DatumGetTSQuery(Datum X)
#define VARATT_IS_COMPRESSED(PTR)
#define VARATT_IS_EXTERNAL(PTR)
#define VARSIZE_ANY_EXHDR(PTR)