|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <math.h>#include "access/htup_details.h"#include "catalog/pg_operator.h"#include "catalog/pg_statistic.h"#include "utils/array.h"#include "utils/fmgrprotos.h"#include "utils/lsyscache.h"#include "utils/selfuncs.h"#include "utils/typcache.h"
Go to the source code of this file.
Macros | |
| #define | DEFAULT_CONTAIN_SEL 0.005 |
| #define | DEFAULT_OVERLAP_SEL 0.01 |
| #define | DEFAULT_SEL(operator) |
| #define | EFFORT 100 |
| #define DEFAULT_CONTAIN_SEL 0.005 |
Definition at line 30 of file array_selfuncs.c.
| #define DEFAULT_OVERLAP_SEL 0.01 |
Definition at line 33 of file array_selfuncs.c.
Definition at line 36 of file array_selfuncs.c.
| #define EFFORT 100 |
| Datum arraycontjoinsel | ( | PG_FUNCTION_ARGS | ) |
Definition at line 321 of file array_selfuncs.c.
References DEFAULT_SEL, PG_GETARG_OID, and PG_RETURN_FLOAT8.
Referenced by _int_contained_joinsel(), _int_contains_joinsel(), and _int_overlap_joinsel().
| Datum arraycontsel | ( | PG_FUNCTION_ARGS | ) |
Definition at line 241 of file array_selfuncs.c.
References calc_arraycontsel(), CLAMP_PROBABILITY, DEFAULT_SEL, fb(), get_base_element_type(), get_restriction_variable(), InvalidOid, IsA, PG_GETARG_INT32, PG_GETARG_OID, PG_GETARG_POINTER, PG_RETURN_FLOAT8, ReleaseVariableStats, and root.
Referenced by _int_contained_sel(), _int_contains_sel(), and _int_overlap_sel().
|
static |
Definition at line 337 of file array_selfuncs.c.
References ATTSTATSSLOT_NUMBERS, ATTSTATSSLOT_VALUES, TypeCacheEntry::cmp_proc_finfo, DatumGetArrayTypeP, DEFAULT_SEL, fb(), FmgrInfo::fn_oid, free_attstatsslot(), get_attstatsslot(), GETSTRUCT(), HeapTupleIsValid, InvalidOid, lookup_type_cache(), mcelem_array_selec(), OidIsValid, pfree(), PointerGetDatum(), statistic_proc_security_check(), and TYPECACHE_CMP_PROC_FINFO.
Referenced by arraycontsel().
Definition at line 1019 of file array_selfuncs.c.
References DEFAULT_CONTAIN_SEL, fb(), i, j, palloc_array, pfree(), and val.
Referenced by mcelem_array_contained_selec().
Definition at line 930 of file array_selfuncs.c.
References fb(), i, palloc_array, and val.
Referenced by mcelem_array_contained_selec().
Definition at line 1174 of file array_selfuncs.c.
References arg, TypeCacheEntry::cmp_proc_finfo, DatumGetInt32(), fb(), FunctionCall2Coll(), and TypeCacheEntry::typcollation.
Referenced by find_next_mcelem(), mcelem_array_contain_overlap_selec(), mcelem_array_contained_selec(), and mcelem_array_selec().
|
static |
Definition at line 1139 of file array_selfuncs.c.
References element_compare(), fb(), i, and value.
Referenced by mcelem_array_contain_overlap_selec().
Definition at line 1190 of file array_selfuncs.c.
References fb().
Referenced by mcelem_array_contained_selec().
Definition at line 1098 of file array_selfuncs.c.
References fb().
Referenced by mcelem_array_contain_overlap_selec().
|
static |
Definition at line 521 of file array_selfuncs.c.
References CLAMP_PROBABILITY, cmp(), DEFAULT_CONTAIN_SEL, element_compare(), fb(), find_next_mcelem(), floor_log2(), i, Min, and nitems.
Referenced by mcelem_array_selec(), and scalararraysel_containment().
|
static |
Definition at line 702 of file array_selfuncs.c.
References b, calc_distr(), calc_hist(), CLAMP_PROBABILITY, cmp(), DEFAULT_CONTAIN_SEL, EFFORT, element_compare(), fb(), float_compare_desc(), i, Min, nitems, palloc_array, pfree(), and qsort.
Referenced by mcelem_array_selec(), and scalararraysel_containment().
|
static |
Definition at line 428 of file array_selfuncs.c.
References deconstruct_array(), element_compare(), elog, ERROR, fb(), i, mcelem_array_contain_overlap_selec(), mcelem_array_contained_selec(), pfree(), qsort_arg(), TypeCacheEntry::typalign, TypeCacheEntry::typbyval, TypeCacheEntry::type_id, and TypeCacheEntry::typlen.
Referenced by calc_arraycontsel().
| Selectivity scalararraysel_containment | ( | PlannerInfo * | root, |
| Node * | leftop, | ||
| Node * | rightop, | ||
| Oid | elemtype, | ||
| bool | isEquality, | ||
| bool | useOr, | ||
| int | varRelid | ||
| ) |
Definition at line 81 of file array_selfuncs.c.
References ATTSTATSSLOT_NUMBERS, ATTSTATSSLOT_VALUES, CLAMP_PROBABILITY, TypeCacheEntry::cmp_proc_finfo, examine_variable(), fb(), FmgrInfo::fn_oid, free_attstatsslot(), get_attstatsslot(), GETSTRUCT(), HeapTupleIsValid, InvalidOid, IsA, lookup_type_cache(), mcelem_array_contain_overlap_selec(), mcelem_array_contained_selec(), OidIsValid, ReleaseVariableStats, root, statistic_proc_security_check(), and TYPECACHE_CMP_PROC_FINFO.
Referenced by scalararraysel().