|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "catalog/pg_operator.h"#include "catalog/pg_proc.h"#include "catalog/pg_type.h"#include "executor/executor.h"#include "miscadmin.h"#include "nodes/makefuncs.h"#include "nodes/nodeFuncs.h"#include "nodes/pathnodes.h"#include "optimizer/optimizer.h"#include "utils/array.h"#include "utils/inval.h"#include "utils/lsyscache.h"#include "utils/syscache.h"
Go to the source code of this file.
Data Structures | |
| struct | PredIterInfoData |
| struct | ArrayConstIterState |
| struct | ArrayExprIterState |
| struct | OprProofCacheKey |
| struct | OprProofCacheEntry |
Macros | |
| #define | MAX_SAOP_ARRAY_SIZE 100 |
| #define | iterate_begin(item, clause, info) |
| #define | iterate_end(info) |
| #define | RCLT COMPARE_LT |
| #define | RCLE COMPARE_LE |
| #define | RCEQ COMPARE_EQ |
| #define | RCGE COMPARE_GE |
| #define | RCGT COMPARE_GT |
| #define | RCNE COMPARE_NE |
| #define | none 0 |
Enumerations | |
| enum | PredClass { CLASS_ATOM , CLASS_AND , CLASS_OR } |
Variables | |
| static const bool | RC_implies_table [6][6] |
| static const bool | RC_refutes_table [6][6] |
| static const CompareType | RC_implic_table [6][6] |
| static const CompareType | RC_refute_table [6][6] |
| static HTAB * | OprProofCacheHash = NULL |
| #define iterate_begin | ( | item, | |
| clause, | |||
| info | |||
| ) |
Definition at line 72 of file predtest.c.
| #define iterate_end | ( | info | ) |
Definition at line 78 of file predtest.c.
| #define MAX_SAOP_ARRAY_SIZE 100 |
Definition at line 40 of file predtest.c.
| #define none 0 |
Definition at line 1670 of file predtest.c.
| #define RCEQ COMPARE_EQ |
Definition at line 1664 of file predtest.c.
| #define RCGE COMPARE_GE |
Definition at line 1665 of file predtest.c.
| #define RCGT COMPARE_GT |
Definition at line 1666 of file predtest.c.
| #define RCLE COMPARE_LE |
Definition at line 1663 of file predtest.c.
| #define RCLT COMPARE_LT |
Definition at line 1662 of file predtest.c.
| #define RCNE COMPARE_NE |
Definition at line 1667 of file predtest.c.
Definition at line 57 of file predtest.c.
| Enumerator | |
|---|---|
| CLASS_ATOM | |
| CLASS_AND | |
| CLASS_OR | |
Definition at line 50 of file predtest.c.
|
static |
Definition at line 1021 of file predtest.c.
References list_free(), pfree(), and PredIterInfoData::state.
Referenced by predicate_classify().
|
static |
Definition at line 1008 of file predtest.c.
References fb(), and PredIterInfoData::state.
Referenced by predicate_classify().
|
static |
Definition at line 959 of file predtest.c.
References ScalarArrayOpExpr::args, ARR_ELEMTYPE, DatumGetArrayTypeP, deconstruct_array(), fb(), get_typlenbyvalalign(), InvalidOid, list_copy(), lsecond, ScalarArrayOpExpr::opno, palloc_object, and PredIterInfoData::state.
Referenced by predicate_classify().
|
static |
Definition at line 1081 of file predtest.c.
References list_free(), pfree(), and PredIterInfoData::state.
Referenced by predicate_classify().
|
static |
Definition at line 1069 of file predtest.c.
References fb(), lfirst, lnext(), lsecond, state::next, PredIterInfoData::state, and PredIterInfoData::state_list.
Referenced by predicate_classify().
|
static |
Definition at line 1042 of file predtest.c.
References ScalarArrayOpExpr::args, fb(), InvalidOid, list_copy(), list_head(), lsecond, state::next, ScalarArrayOpExpr::opno, palloc_object, PredIterInfoData::state, and PredIterInfoData::state_list.
Referenced by predicate_classify().
|
static |
Definition at line 938 of file predtest.c.
References list_head(), PredIterInfoData::state, and PredIterInfoData::state_list.
Referenced by predicate_classify().
Definition at line 1460 of file predtest.c.
References arg, ScalarArrayOpExpr::args, ARR_DIMS, ARR_NDIM, ArrayGetNItems(), clause_is_strict_for(), DatumGetArrayTypeP, equal(), fb(), func_strict(), is_funcclause(), is_opclause(), IsA, lfirst, linitial, list_length(), lsecond, op_strict(), ScalarArrayOpExpr::opno, and ScalarArrayOpExpr::useOr.
Referenced by clause_is_strict_for(), predicate_implied_by_simple_clause(), and predicate_refuted_by_simple_clause().
Definition at line 1386 of file predtest.c.
References fb(), IS_FALSE, IS_NOT_TRUE, IS_UNKNOWN, IsA, linitial, and NOT_EXPR.
Referenced by predicate_refuted_by_recurse().
Definition at line 1414 of file predtest.c.
References fb(), IS_FALSE, IsA, linitial, and NOT_EXPR.
Referenced by predicate_refuted_by_recurse().
Definition at line 2330 of file predtest.c.
References fb(), and lookup_proof_cache().
Referenced by operator_predicate_proof().
Definition at line 2346 of file predtest.c.
References Assert, fb(), hash_seq_init(), hash_seq_search(), and OprProofCacheHash.
Referenced by lookup_proof_cache().
|
static |
Definition at line 928 of file predtest.c.
Referenced by predicate_classify().
|
static |
Definition at line 915 of file predtest.c.
References fb(), lfirst, lnext(), PredIterInfoData::state, and PredIterInfoData::state_list.
Referenced by predicate_classify().
|
static |
Definition at line 908 of file predtest.c.
References list_head(), PredIterInfoData::state, and PredIterInfoData::state_list.
Referenced by predicate_classify().
|
static |
Definition at line 2101 of file predtest.c.
References Assert, CacheRegisterSyscacheCallback(), COMPARE_EQ, ctl, fb(), get_negator(), get_op_index_interpretation(), get_opfamily_member_for_cmptype(), HASH_BLOBS, hash_create(), HASH_ELEM, HASH_ENTER, hash_search(), InvalidateOprProofCacheCallBack(), InvalidOid, HASHCTL::keysize, lfirst, list_free_deep(), NIL, OidIsValid, op_volatile(), OprProofCacheHash, RC_implic_table, RC_implies_table, RC_refute_table, RC_refutes_table, and RCNE.
Referenced by get_btree_test_op(), and operator_same_subexprs_lookup().
|
static |
Definition at line 1779 of file predtest.c.
References CreateExecutorState(), DatumGetBool(), DEBUG2, elog, equal(), EState::es_query_cxt, ExecEvalExprSwitchContext(), ExecInitExpr(), fb(), fix_opfuncids(), FreeExecutorState(), get_btree_test_op(), get_commutator(), GetPerTupleExprContext, InvalidOid, is_opclause(), IsA, linitial, list_length(), lsecond, make_opclause(), MemoryContextSwitchTo(), OidIsValid, op_strict(), and operator_same_subexprs_proof().
Referenced by predicate_implied_by_simple_clause(), and predicate_refuted_by_simple_clause().
Definition at line 2305 of file predtest.c.
References fb(), and lookup_proof_cache().
Referenced by operator_same_subexprs_proof().
Definition at line 2032 of file predtest.c.
References fb(), get_negator(), and operator_same_subexprs_lookup().
Referenced by operator_predicate_proof().
|
static |
Definition at line 826 of file predtest.c.
References ScalarArrayOpExpr::args, ARR_DIMS, ARR_NDIM, arrayconst_cleanup_fn(), arrayconst_next_fn(), arrayconst_startup_fn(), arrayexpr_cleanup_fn(), arrayexpr_next_fn(), arrayexpr_startup_fn(), ArrayGetNItems(), Assert, boolexpr_startup_fn(), CLASS_AND, CLASS_ATOM, CLASS_OR, PredIterInfoData::cleanup_fn, DatumGetArrayTypeP, fb(), is_andclause(), is_orclause(), IsA, list_cleanup_fn(), list_length(), list_next_fn(), list_startup_fn(), lsecond, MAX_SAOP_ARRAY_SIZE, PredIterInfoData::next_fn, PredIterInfoData::startup_fn, and ScalarArrayOpExpr::useOr.
Referenced by predicate_implied_by_recurse(), and predicate_refuted_by_recurse().
Definition at line 152 of file predtest.c.
References fb(), linitial, list_length(), NIL, and predicate_implied_by_recurse().
Referenced by add_predicate_to_index_quals(), build_paths_for_OR(), check_index_predicates(), choose_bitmap_and(), ConstraintImpliedByRelConstraint(), create_bitmap_scan_plan(), create_bitmap_subplan(), create_indexscan_plan(), infer_arbiter_indexes(), and test_predtest().
Definition at line 290 of file predtest.c.
References Assert, CLASS_AND, CLASS_ATOM, CLASS_OR, elog, ERROR, fb(), IsA, iterate_begin, iterate_end, predicate_classify(), predicate_implied_by_recurse(), and predicate_implied_by_simple_clause().
Referenced by predicate_implied_by(), predicate_implied_by_recurse(), and predicate_refuted_by_recurse().
|
static |
Definition at line 1098 of file predtest.c.
References OpExpr::args, Assert, CHECK_FOR_INTERRUPTS, clause_is_strict_for(), DatumGetBool(), equal(), fb(), get_notclausearg(), IS_NOT_NULL, is_notclause(), IS_NULL, IsA, linitial, list_length(), lsecond, nodeTag, operator_predicate_proof(), and OpExpr::opno.
Referenced by predicate_implied_by_recurse().
Definition at line 222 of file predtest.c.
References fb(), linitial, list_length(), NIL, and predicate_refuted_by_recurse().
Referenced by gen_partprune_steps_internal(), relation_excluded_by_constraints(), and test_predtest().
Definition at line 531 of file predtest.c.
References Assert, CLASS_AND, CLASS_ATOM, CLASS_OR, elog, ERROR, extract_not_arg(), extract_strong_not_arg(), fb(), IsA, iterate_begin, iterate_end, predicate_classify(), predicate_implied_by_recurse(), predicate_refuted_by_recurse(), and predicate_refuted_by_simple_clause().
Referenced by predicate_refuted_by(), and predicate_refuted_by_recurse().
|
static |
Definition at line 1225 of file predtest.c.
References CHECK_FOR_INTERRUPTS, clause_is_strict_for(), equal(), fb(), IS_NOT_NULL, IS_NULL, nodeTag, and operator_predicate_proof().
Referenced by predicate_refuted_by_recurse().
Definition at line 2093 of file predtest.c.
Referenced by InvalidateOprProofCacheCallBack(), and lookup_proof_cache().
|
static |
Definition at line 1698 of file predtest.c.
Referenced by lookup_proof_cache().
Definition at line 1672 of file predtest.c.
Referenced by lookup_proof_cache().
|
static |
Definition at line 1711 of file predtest.c.
Referenced by lookup_proof_cache().
Definition at line 1685 of file predtest.c.
Referenced by lookup_proof_cache().