~ubuntu-branches/ubuntu/trusty/postgresql-8.4/trusty

« back to all changes in this revision

Viewing changes to src/backend/optimizer/util/predtest.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-11 16:59:35 UTC
  • mfrom: (5.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090711165935-jfwin6gfrxf0gfsi
Tags: 8.4.0-2
* debian/libpq-dev.install: Ship catalog/genbki.h. (Closes: #536139)
* debian/rules: Drop --enable-cassert for final release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 *
10
10
 *
11
11
 * IDENTIFICATION
12
 
 *        $PostgreSQL: pgsql/src/backend/optimizer/util/predtest.c,v 1.26 2009/05/11 17:56:08 tgl Exp $
 
12
 *        $PostgreSQL: pgsql/src/backend/optimizer/util/predtest.c,v 1.27 2009/06/11 14:48:59 momjian Exp $
13
13
 *
14
14
 *-------------------------------------------------------------------------
15
15
 */
98
98
static bool list_member_strip(List *list, Expr *datum);
99
99
static bool btree_predicate_proof(Expr *predicate, Node *clause,
100
100
                                          bool refute_it);
101
 
static Oid get_btree_test_op(Oid pred_op, Oid clause_op, bool refute_it);
 
101
static Oid      get_btree_test_op(Oid pred_op, Oid clause_op, bool refute_it);
102
102
static void InvalidateOprProofCacheCallBack(Datum arg, int cacheid, ItemPointer tuplePtr);
103
103
 
104
104
 
134
134
 
135
135
        /*
136
136
         * If either input is a single-element list, replace it with its lone
137
 
         * member; this avoids one useless level of AND-recursion.  We only need
 
137
         * member; this avoids one useless level of AND-recursion.      We only need
138
138
         * to worry about this at top level, since eval_const_expressions should
139
139
         * have gotten rid of any trivial ANDs or ORs below that.
140
140
         */
192
192
 
193
193
        /*
194
194
         * If either input is a single-element list, replace it with its lone
195
 
         * member; this avoids one useless level of AND-recursion.  We only need
 
195
         * member; this avoids one useless level of AND-recursion.      We only need
196
196
         * to worry about this at top level, since eval_const_expressions should
197
197
         * have gotten rid of any trivial ANDs or ORs below that.
198
198
         */
652
652
                case CLASS_ATOM:
653
653
 
654
654
#ifdef NOT_USED
 
655
 
655
656
                        /*
656
657
                         * If A is a NOT-clause, A R=> B if B => A's arg
657
658
                         *
658
659
                         * Unfortunately not: this would only prove that B is not-TRUE,
659
660
                         * not that it's not NULL either.  Keep this code as a comment
660
 
                         * because it would be useful if we ever had a need for the
661
 
                         * weak form of refutation.
 
661
                         * because it would be useful if we ever had a need for the weak
 
662
                         * form of refutation.
662
663
                         */
663
664
                        not_arg = extract_not_arg(clause);
664
665
                        if (not_arg &&
738
739
 * This function also implements enforcement of MAX_SAOP_ARRAY_SIZE: if a
739
740
 * ScalarArrayOpExpr's array has too many elements, we just classify it as an
740
741
 * atom.  (This will result in its being passed as-is to the simple_clause
741
 
 * functions, which will fail to prove anything about it.)  Note that we
 
742
 * functions, which will fail to prove anything about it.)      Note that we
742
743
 * cannot just stop after considering MAX_SAOP_ARRAY_SIZE elements; in general
743
744
 * that would result in wrong proofs, rather than failing to prove anything.
744
745
 */
1484
1485
 
1485
1486
        bool            have_implic;    /* do we know the implication result? */
1486
1487
        bool            have_refute;    /* do we know the refutation result? */
1487
 
        Oid                     implic_test_op; /* OID of the operator, or 0 if none */
1488
 
        Oid                     refute_test_op; /* OID of the operator, or 0 if none */
 
1488
        Oid                     implic_test_op; /* OID of the operator, or 0 if none */
 
1489
        Oid                     refute_test_op; /* OID of the operator, or 0 if none */
1489
1490
} OprProofCacheEntry;
1490
1491
 
1491
1492
static HTAB *OprProofCacheHash = NULL;