22#include "utils/fmgrprotos.h"
32#define DEFAULT_TS_MATCH_SEL 0.005
51 const float4 *numbers,
int nnumbers);
56#define tsquery_opr_selec_no_stats(query) \
57 tsquery_opr_selec(GETQUERY(query), GETOPERAND(query), NULL, 0, 0)
159 if (query->
size == 0)
191 selec *= (1.0 - stats->stanullfrac);
208 const float4 *numbers,
int nnumbers)
245 minfreq = numbers[nnumbers - 2];
294 key.lexeme = operand +
oper->distance;
295 key.length =
oper->length;
324 for (
i = 0;
i < length;
i++)
329 if (
tlen >= key.length &&
450 else if (len1 < len2)
#define Assert(condition)
#define palloc_array(type, count)
#define PG_RETURN_FLOAT8(x)
#define PG_GETARG_POINTER(n)
#define PG_GETARG_INT32(n)
#define HeapTupleIsValid(tuple)
static void * GETSTRUCT(const HeapTupleData *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, const Datum *mcelem, int nmcelem, const float4 *numbers, int nnumbers)
static TSQuery DatumGetTSQuery(Datum X)
static Size VARSIZE_ANY_EXHDR(const void *PTR)
static bool VARATT_IS_EXTERNAL(const void *PTR)
static char * VARDATA_ANY(const void *PTR)
static bool VARATT_IS_COMPRESSED(const void *PTR)