PostgreSQL Source Code
git master
|
#include "postgres.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 | BTLT BTLessStrategyNumber |
#define | BTLE BTLessEqualStrategyNumber |
#define | BTEQ BTEqualStrategyNumber |
#define | BTGE BTGreaterEqualStrategyNumber |
#define | BTGT BTGreaterStrategyNumber |
#define | BTNE ROWCOMPARE_NE |
#define | none 0 |
Typedefs | |
typedef struct PredIterInfoData * | PredIterInfo |
typedef struct PredIterInfoData | PredIterInfoData |
typedef struct OprProofCacheKey | OprProofCacheKey |
typedef struct OprProofCacheEntry | OprProofCacheEntry |
Enumerations | |
enum | PredClass { CLASS_ATOM , CLASS_AND , CLASS_OR } |
Variables | |
static const bool | BT_implies_table [6][6] |
static const bool | BT_refutes_table [6][6] |
static const StrategyNumber | BT_implic_table [6][6] |
static const StrategyNumber | BT_refute_table [6][6] |
static HTAB * | OprProofCacheHash = NULL |
#define BTEQ BTEqualStrategyNumber |
Definition at line 1527 of file predtest.c.
#define BTGE BTGreaterEqualStrategyNumber |
Definition at line 1528 of file predtest.c.
#define BTGT BTGreaterStrategyNumber |
Definition at line 1529 of file predtest.c.
#define BTLE BTLessEqualStrategyNumber |
Definition at line 1526 of file predtest.c.
#define BTLT BTLessStrategyNumber |
Definition at line 1525 of file predtest.c.
#define BTNE ROWCOMPARE_NE |
Definition at line 1530 of file predtest.c.
#define iterate_begin | ( | item, | |
clause, | |||
info | |||
) |
Definition at line 71 of file predtest.c.
#define iterate_end | ( | info | ) |
Definition at line 77 of file predtest.c.
#define MAX_SAOP_ARRAY_SIZE 100 |
Definition at line 39 of file predtest.c.
#define none 0 |
Definition at line 1533 of file predtest.c.
typedef struct OprProofCacheEntry OprProofCacheEntry |
typedef struct OprProofCacheKey OprProofCacheKey |
typedef struct PredIterInfoData* PredIterInfo |
Definition at line 56 of file predtest.c.
typedef struct PredIterInfoData PredIterInfoData |
enum PredClass |
|
static |
Definition at line 1020 of file predtest.c.
References list_free(), pfree(), and PredIterInfoData::state.
Referenced by predicate_classify().
|
static |
Definition at line 1007 of file predtest.c.
References if(), and PredIterInfoData::state.
Referenced by predicate_classify().
|
static |
Definition at line 958 of file predtest.c.
References ScalarArrayOpExpr::args, ARR_ELEMTYPE, Const::constcollid, Const::constvalue, DatumGetArrayTypeP, deconstruct_array(), get_typlenbyvalalign(), ScalarArrayOpExpr::inputcollid, InvalidOid, list_copy(), lsecond, ScalarArrayOpExpr::opfuncid, ScalarArrayOpExpr::opno, palloc(), PredIterInfoData::state, T_Const, and T_OpExpr.
Referenced by predicate_classify().
|
static |
Definition at line 1080 of file predtest.c.
References list_free(), pfree(), and PredIterInfoData::state.
Referenced by predicate_classify().
|
static |
Definition at line 1068 of file predtest.c.
References if(), lfirst, lnext(), lsecond, state::next, PredIterInfoData::state, and PredIterInfoData::state_list.
Referenced by predicate_classify().
|
static |
Definition at line 1041 of file predtest.c.
References ScalarArrayOpExpr::args, ArrayExpr::elements, ScalarArrayOpExpr::inputcollid, InvalidOid, list_copy(), list_head(), lsecond, state::next, ScalarArrayOpExpr::opfuncid, ScalarArrayOpExpr::opno, palloc(), PredIterInfoData::state, PredIterInfoData::state_list, and T_OpExpr.
Referenced by predicate_classify().
|
static |
Definition at line 937 of file predtest.c.
References list_head(), PredIterInfoData::state, and PredIterInfoData::state_list.
Referenced by predicate_classify().
Definition at line 1323 of file predtest.c.
References arg, ScalarArrayOpExpr::args, ARR_DIMS, ARR_NDIM, ArrayGetNItems(), Const::constisnull, Const::constvalue, DatumGetArrayTypeP, equal(), func_strict(), is_funcclause(), is_opclause(), IsA, lfirst, linitial, list_length(), lsecond, op_strict(), ScalarArrayOpExpr::opno, and ScalarArrayOpExpr::useOr.
Referenced by predicate_implied_by_simple_clause(), and predicate_refuted_by_simple_clause().
Definition at line 1249 of file predtest.c.
References BooleanTest::arg, BoolExpr::args, BoolExpr::boolop, BooleanTest::booltesttype, IS_FALSE, IS_NOT_TRUE, IS_UNKNOWN, IsA, linitial, and NOT_EXPR.
Referenced by predicate_refuted_by_recurse().
Definition at line 1277 of file predtest.c.
References BooleanTest::arg, BoolExpr::args, BoolExpr::boolop, BooleanTest::booltesttype, IS_FALSE, IsA, linitial, and NOT_EXPR.
Referenced by predicate_refuted_by_recurse().
Definition at line 2193 of file predtest.c.
References OprProofCacheEntry::implic_test_op, lookup_proof_cache(), and OprProofCacheEntry::refute_test_op.
Referenced by operator_predicate_proof().
Definition at line 2209 of file predtest.c.
References Assert(), hash_seq_init(), hash_seq_search(), OprProofCacheEntry::have_implic, OprProofCacheEntry::have_refute, OprProofCacheHash, and status().
Referenced by lookup_proof_cache().
|
static |
Definition at line 927 of file predtest.c.
Referenced by predicate_classify().
|
static |
Definition at line 914 of file predtest.c.
References if(), lfirst, lnext(), PredIterInfoData::state, and PredIterInfoData::state_list.
Referenced by predicate_classify().
|
static |
Definition at line 907 of file predtest.c.
References list_head(), PredIterInfoData::state, and PredIterInfoData::state_list.
Referenced by predicate_classify().
|
static |
Definition at line 1964 of file predtest.c.
References AMOPOPID, Assert(), BT_implic_table, BT_implies_table, BT_refute_table, BT_refutes_table, BTEqualStrategyNumber, BTNE, CacheRegisterSyscacheCallback(), HASHCTL::entrysize, get_negator(), get_op_btree_interpretation(), get_opfamily_member(), HASH_BLOBS, hash_create(), HASH_ELEM, HASH_ENTER, hash_search(), OprProofCacheEntry::have_implic, OprProofCacheEntry::have_refute, OprProofCacheEntry::implic_test_op, InvalidateOprProofCacheCallBack(), InvalidOid, sort-test::key, HASHCTL::keysize, lfirst, list_free_deep(), NIL, OidIsValid, op_volatile(), OpBtreeInterpretation::opfamily_id, OpBtreeInterpretation::oplefttype, OpBtreeInterpretation::oprighttype, OprProofCacheHash, OprProofCacheEntry::refute_test_op, OprProofCacheEntry::same_subexprs_implies, OprProofCacheEntry::same_subexprs_refutes, and OpBtreeInterpretation::strategy.
Referenced by get_btree_test_op(), and operator_same_subexprs_lookup().
|
static |
Definition at line 1642 of file predtest.c.
References OpExpr::args, Const::constisnull, CreateExecutorState(), DatumGetBool, DEBUG2, elog, equal(), EState::es_query_cxt, ExecEvalExprSwitchContext(), ExecInitExpr(), fix_opfuncids(), FreeExecutorState(), get_btree_test_op(), get_commutator(), GetPerTupleExprContext, OpExpr::inputcollid, InvalidOid, is_opclause(), IsA, linitial, list_length(), lsecond, make_opclause(), MemoryContextSwitchTo(), OidIsValid, op_strict(), operator_same_subexprs_proof(), and OpExpr::opno.
Referenced by predicate_implied_by_simple_clause(), and predicate_refuted_by_simple_clause().
Definition at line 2168 of file predtest.c.
References lookup_proof_cache(), OprProofCacheEntry::same_subexprs_implies, and OprProofCacheEntry::same_subexprs_refutes.
Referenced by operator_same_subexprs_proof().
Definition at line 1895 of file predtest.c.
References get_negator(), and operator_same_subexprs_lookup().
Referenced by operator_predicate_proof().
|
static |
Definition at line 825 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, 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 151 of file predtest.c.
References 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 289 of file predtest.c.
References Assert(), CLASS_AND, CLASS_ATOM, CLASS_OR, elog, ERROR, IsA, iterate_begin, iterate_end, predicate_classify(), and predicate_implied_by_simple_clause().
Referenced by predicate_implied_by(), and predicate_refuted_by_recurse().
|
static |
Definition at line 1117 of file predtest.c.
References NullTest::arg, NullTest::argisrow, CHECK_FOR_INTERRUPTS, clause_is_strict_for(), equal(), IS_NOT_NULL, IsA, NullTest::nulltesttype, and operator_predicate_proof().
Referenced by predicate_implied_by_recurse().
Definition at line 221 of file predtest.c.
References 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 530 of file predtest.c.
References Assert(), CLASS_AND, CLASS_ATOM, CLASS_OR, elog, ERROR, extract_not_arg(), extract_strong_not_arg(), IsA, iterate_begin, iterate_end, predicate_classify(), predicate_implied_by_recurse(), and predicate_refuted_by_simple_clause().
Referenced by predicate_refuted_by().
|
static |
Definition at line 1179 of file predtest.c.
References arg, CHECK_FOR_INTERRUPTS, clause_is_strict_for(), equal(), IS_NOT_NULL, IS_NULL, IsA, and operator_predicate_proof().
Referenced by predicate_refuted_by_recurse().
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 1956 of file predtest.c.
Referenced by InvalidateOprProofCacheCallBack(), and lookup_proof_cache().