PostgreSQL Source Code git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "catalog/pg_statistic.h"
#include "catalog/pg_type.h"
#include "miscadmin.h"
#include "nodes/nodes.h"
#include "tsearch/ts_type.h"
#include "utils/fmgrprotos.h"
#include "utils/lsyscache.h"
#include "utils/selfuncs.h"
Go to the source code of this file.
Data Structures | |
struct | TextFreq |
struct | LexemeKey |
Macros | |
#define | DEFAULT_TS_MATCH_SEL 0.005 |
#define | tsquery_opr_selec_no_stats(query) tsquery_opr_selec(GETQUERY(query), GETOPERAND(query), NULL, 0, 0) |
Functions | |
static Selectivity | tsquerysel (VariableStatData *vardata, Datum constval) |
static Selectivity | mcelem_tsquery_selec (TSQuery query, Datum *mcelem, int nmcelem, float4 *numbers, int nnumbers) |
static Selectivity | tsquery_opr_selec (QueryItem *item, char *operand, TextFreq *lookup, int length, float4 minfreq) |
static int | compare_lexeme_textfreq (const void *e1, const void *e2) |
Datum | tsmatchsel (PG_FUNCTION_ARGS) |
Datum | tsmatchjoinsel (PG_FUNCTION_ARGS) |
#define DEFAULT_TS_MATCH_SEL 0.005 |
Definition at line 32 of file ts_selfuncs.c.
#define tsquery_opr_selec_no_stats | ( | query | ) | tsquery_opr_selec(GETQUERY(query), GETOPERAND(query), NULL, 0, 0) |
Definition at line 56 of file ts_selfuncs.c.
|
static |
Definition at line 434 of file ts_selfuncs.c.
References TextFreq::element, sort-test::key, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by tsquery_opr_selec().
|
static |
Definition at line 207 of file ts_selfuncs.c.
References Assert, DatumGetPointer(), GETOPERAND, GETQUERY, i, palloc(), pfree(), tsquery_opr_selec(), tsquery_opr_selec_no_stats, VARATT_IS_COMPRESSED, and VARATT_IS_EXTERNAL.
Referenced by tsquerysel().
Datum tsmatchjoinsel | ( | PG_FUNCTION_ARGS | ) |
Definition at line 139 of file ts_selfuncs.c.
References DEFAULT_TS_MATCH_SEL, and PG_RETURN_FLOAT8.
Datum tsmatchsel | ( | PG_FUNCTION_ARGS | ) |
Definition at line 67 of file ts_selfuncs.c.
References generate_unaccent_rules::args, Assert, CLAMP_PROBABILITY, DEFAULT_TS_MATCH_SEL, get_restriction_variable(), IsA, PG_GETARG_INT32, PG_GETARG_OID, PG_GETARG_POINTER, PG_RETURN_FLOAT8, ReleaseVariableStats, root, tsquerysel(), and VariableStatData::vartype.
|
static |
Definition at line 278 of file ts_selfuncs.c.
References check_stack_depth(), CLAMP_PROBABILITY, compare_lexeme_textfreq(), DEFAULT_TS_MATCH_SEL, TextFreq::element, elog, ERROR, TextFreq::frequency, i, sort-test::key, QueryOperator::left, Max, Min, OP_AND, OP_NOT, OP_OR, OP_PHRASE, oper(), QueryOperator::oper, QI_VAL, QueryItem::qoperator, s1, s2, tsquery_opr_selec(), QueryItem::type, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by mcelem_tsquery_selec(), and tsquery_opr_selec().
|
static |
Definition at line 150 of file ts_selfuncs.c.
References ATTSTATSSLOT_NUMBERS, ATTSTATSSLOT_VALUES, DatumGetTSQuery(), free_attstatsslot(), get_attstatsslot(), GETSTRUCT(), HeapTupleIsValid, InvalidOid, mcelem_tsquery_selec(), AttStatsSlot::nnumbers, AttStatsSlot::numbers, AttStatsSlot::nvalues, TSQueryData::size, VariableStatData::statsTuple, tsquery_opr_selec_no_stats, and AttStatsSlot::values.
Referenced by tsmatchsel().