40#define MAX_SAOP_ARRAY_SIZE 100
72#define iterate_begin(item, clause, info) \
75 (info).startup_fn((clause), &(info)); \
76 while ((item = (info).next_fn(&(info))) != NULL)
78#define iterate_end(info) \
79 (info).cleanup_fn(&(info)); \
495 elog(
ERROR,
"predicate_classify returned a bogus value");
806 elog(
ERROR,
"predicate_classify returned a bogus value");
987 state->opexpr.opfuncid = saop->opfuncid;
989 state->opexpr.opretset =
false;
991 state->opexpr.inputcollid = saop->inputcollid;
997 state->const_expr.consttypmod = -1;
1004 state->next_elem = 0;
1055 state->opexpr.opfuncid = saop->opfuncid;
1057 state->opexpr.opretset =
false;
1059 state->opexpr.inputcollid = saop->inputcollid;
1491 foreach(
lc, ((
OpExpr *) clause)->args)
1601 return ((
Const *) clause)->constisnull;
1662#define RCLT COMPARE_LT
1663#define RCLE COMPARE_LE
1664#define RCEQ COMPARE_EQ
1665#define RCGE COMPARE_GE
1666#define RCGT COMPARE_GT
1667#define RCNE COMPARE_NE
2054 if (pred_op == clause_op)
2133 key.pred_op = pred_op;
2134 key.clause_op = clause_op;
2358 hentry->have_implic =
false;
2359 hentry->have_refute =
false;
#define DatumGetArrayTypeP(X)
void deconstruct_array(const ArrayType *array, Oid elmtype, int elmlen, bool elmbyval, char elmalign, Datum **elemsp, bool **nullsp, int *nelemsp)
int ArrayGetNItems(int ndim, const int *dims)
#define Assert(condition)
#define OidIsValid(objectId)
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
HTAB * hash_create(const char *tabname, int64 nelem, const HASHCTL *info, int flags)
void * hash_seq_search(HASH_SEQ_STATUS *status)
void hash_seq_init(HASH_SEQ_STATUS *status, HTAB *hashp)
bool equal(const void *a, const void *b)
ExprState * ExecInitExpr(Expr *node, PlanState *parent)
void FreeExecutorState(EState *estate)
EState * CreateExecutorState(void)
#define GetPerTupleExprContext(estate)
static Datum ExecEvalExprSwitchContext(ExprState *state, ExprContext *econtext, bool *isNull)
#define palloc_object(type)
void CacheRegisterSyscacheCallback(int cacheid, SyscacheCallbackFunction func, Datum arg)
List * list_copy(const List *oldlist)
void list_free(List *list)
void list_free_deep(List *list)
Oid get_opfamily_member_for_cmptype(Oid opfamily, Oid lefttype, Oid righttype, CompareType cmptype)
void get_typlenbyvalalign(Oid typid, int16 *typlen, bool *typbyval, char *typalign)
bool func_strict(Oid funcid)
List * get_op_index_interpretation(Oid opno)
char op_volatile(Oid opno)
Oid get_negator(Oid opno)
Oid get_commutator(Oid opno)
Expr * make_opclause(Oid opno, Oid opresulttype, bool opretset, Expr *leftop, Expr *rightop, Oid opcollid, Oid inputcollid)
void pfree(void *pointer)
#define CHECK_FOR_INTERRUPTS()
void fix_opfuncids(Node *node)
static bool is_andclause(const void *clause)
static bool is_orclause(const void *clause)
static bool is_opclause(const void *clause)
static bool is_funcclause(const void *clause)
static bool is_notclause(const void *clause)
static Expr * get_notclausearg(const void *notclause)
#define IsA(nodeptr, _type_)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
static int list_length(const List *l)
static ListCell * list_head(const List *l)
static ListCell * lnext(const List *l, const ListCell *c)
static bool DatumGetBool(Datum X)
static bool predicate_refuted_by_simple_clause(Expr *predicate, Node *clause, bool weak)
static Node * arrayconst_next_fn(PredIterInfo info)
struct PredIterInfoData * PredIterInfo
static Node * arrayexpr_next_fn(PredIterInfo info)
bool predicate_refuted_by(List *predicate_list, List *clause_list, bool weak)
static const CompareType RC_implic_table[6][6]
static bool operator_same_subexprs_proof(Oid pred_op, Oid clause_op, bool refute_it)
static HTAB * OprProofCacheHash
#define iterate_end(info)
static void InvalidateOprProofCacheCallBack(Datum arg, int cacheid, uint32 hashvalue)
static const bool RC_refutes_table[6][6]
static const bool RC_implies_table[6][6]
static bool predicate_implied_by_recurse(Node *clause, Node *predicate, bool weak)
static OprProofCacheEntry * lookup_proof_cache(Oid pred_op, Oid clause_op, bool refute_it)
static void arrayexpr_startup_fn(Node *clause, PredIterInfo info)
static Node * extract_strong_not_arg(Node *clause)
static bool predicate_implied_by_simple_clause(Expr *predicate, Node *clause, bool weak)
static Node * extract_not_arg(Node *clause)
static PredClass predicate_classify(Node *clause, PredIterInfo info)
static bool predicate_refuted_by_recurse(Node *clause, Node *predicate, bool weak)
static bool clause_is_strict_for(Node *clause, Node *subexpr, bool allow_false)
static bool operator_predicate_proof(Expr *predicate, Node *clause, bool refute_it, bool weak)
bool predicate_implied_by(List *predicate_list, List *clause_list, bool weak)
static void boolexpr_startup_fn(Node *clause, PredIterInfo info)
static void arrayconst_startup_fn(Node *clause, PredIterInfo info)
#define MAX_SAOP_ARRAY_SIZE
static void list_cleanup_fn(PredIterInfo info)
static Node * list_next_fn(PredIterInfo info)
static void arrayconst_cleanup_fn(PredIterInfo info)
static Oid get_btree_test_op(Oid pred_op, Oid clause_op, bool refute_it)
#define iterate_begin(item, clause, info)
static void list_startup_fn(Node *clause, PredIterInfo info)
static void arrayexpr_cleanup_fn(PredIterInfo info)
static bool operator_same_subexprs_lookup(Oid pred_op, Oid clause_op, bool refute_it)
static const CompareType RC_refute_table[6][6]
MemoryContext es_query_cxt
bool same_subexprs_refutes
bool same_subexprs_implies
void(* startup_fn)(Node *clause, PredIterInfo info)
void(* cleanup_fn)(PredIterInfo info)
Node *(* next_fn)(PredIterInfo info)