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 | 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 1664 of file predtest.c.
#define BTGE BTGreaterEqualStrategyNumber |
Definition at line 1665 of file predtest.c.
#define BTGT BTGreaterStrategyNumber |
Definition at line 1666 of file predtest.c.
#define BTLE BTLessEqualStrategyNumber |
Definition at line 1663 of file predtest.c.
#define BTLT BTLessStrategyNumber |
Definition at line 1662 of file predtest.c.
#define BTNE ROWCOMPARE_NE |
Definition at line 1667 of file predtest.c.
#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.
typedef struct OprProofCacheEntry OprProofCacheEntry |
typedef struct OprProofCacheKey OprProofCacheKey |
typedef struct PredIterInfoData* PredIterInfo |
Definition at line 57 of file predtest.c.
typedef struct PredIterInfoData PredIterInfoData |
enum PredClass |
|
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 if(), and PredIterInfoData::state.
Referenced by predicate_classify().
|
static |
Definition at line 959 of file predtest.c.
References ScalarArrayOpExpr::args, ARR_ELEMTYPE, DatumGetArrayTypeP, deconstruct_array(), get_typlenbyvalalign(), InvalidOid, list_copy(), lsecond, ScalarArrayOpExpr::opno, palloc(), 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 if(), 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, ArrayExpr::elements, InvalidOid, list_copy(), list_head(), lsecond, state::next, ScalarArrayOpExpr::opno, palloc(), 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(), 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 1386 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 1414 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 2330 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 2346 of file predtest.c.
References Assert, hash_seq_init(), hash_seq_search(), OprProofCacheEntry::have_implic, OprProofCacheEntry::have_refute, 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 if(), 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, BT_implic_table, BT_implies_table, BT_refute_table, BT_refutes_table, BTEqualStrategyNumber, BTNE, CacheRegisterSyscacheCallback(), ctl, 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, 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 1779 of file predtest.c.
References OpExpr::args, CreateExecutorState(), DatumGetBool(), DEBUG2, elog, equal(), EState::es_query_cxt, ExecEvalExprSwitchContext(), ExecInitExpr(), fix_opfuncids(), FreeExecutorState(), get_btree_test_op(), get_commutator(), GetPerTupleExprContext, 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 2305 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 2032 of file predtest.c.
References 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, 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 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, 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 1098 of file predtest.c.
References NullTest::arg, OpExpr::args, Assert, CHECK_FOR_INTERRUPTS, clause_is_strict_for(), DatumGetBool(), equal(), get_notclausearg(), IS_NOT_NULL, is_notclause(), IS_NULL, IsA, linitial, list_length(), lsecond, nodeTag, NullTest::nulltesttype, operator_predicate_proof(), and OpExpr::opno.
Referenced by predicate_implied_by_recurse().
Definition at line 222 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 531 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 1225 of file predtest.c.
References NullTest::arg, CHECK_FOR_INTERRUPTS, clause_is_strict_for(), equal(), IS_NOT_NULL, IS_NULL, nodeTag, NullTest::nulltesttype, and operator_predicate_proof().
Referenced by predicate_refuted_by_recurse().
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 2093 of file predtest.c.
Referenced by InvalidateOprProofCacheCallBack(), and lookup_proof_cache().