Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc99ddfc

Browse files
committed
Enable btree_predicate_proof() to make proofs involving cross-data-type
predicate operators. The hard stuff turns out to be already done in theprevious commit, we need merely open the floodgates...
1 parent91868e7 commitc99ddfc

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

‎src/backend/optimizer/util/predtest.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/optimizer/util/predtest.c,v 1.11 2006/12/23 00:43:11 tgl Exp $
12+
* $PostgreSQL: pgsql/src/backend/optimizer/util/predtest.c,v 1.12 2006/12/28 19:53:05 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -1131,7 +1131,7 @@ static const StrategyNumber BT_refute_table[6][6] = {
11311131
};
11321132

11331133

1134-
/*----------
1134+
/*
11351135
* btree_predicate_proof
11361136
* Does the predicate implication or refutation test for a "simple clause"
11371137
* predicate and a "simple clause" restriction, when both are simple
@@ -1152,7 +1152,6 @@ static const StrategyNumber BT_refute_table[6][6] = {
11521152
* the operators are too. As of 8.0 it's possible for opfamilies to contain
11531153
* operators that are merely stable, and we dare not make deductions with
11541154
* these.)
1155-
*----------
11561155
*/
11571156
staticbool
11581157
btree_predicate_proof(Expr*predicate,Node*clause,boolrefute_it)
@@ -1274,15 +1273,9 @@ btree_predicate_proof(Expr *predicate, Node *clause, bool refute_it)
12741273
/*
12751274
* Try to find a btree opfamily containing the needed operators.
12761275
*
1277-
* XXX this needs work!!!!!!!!!!!!!!!!!!!!!!!
1278-
*
12791276
* We must find a btree opfamily that contains both operators, else the
1280-
* implication can't be determined. Also, the pred_op has to be of
1281-
* default subtype (implying left and right input datatypes are the same);
1282-
* otherwise it's unsafe to put the pred_const on the left side of the
1283-
* test. Also, the opfamily must contain a suitable test operator matching
1284-
* the clause_const's type (which we take to mean that it has the same
1285-
* subtype as the original clause_operator).
1277+
* implication can't be determined. Also, the opfamily must contain a
1278+
* suitable test operator taking the pred_const and clause_const datatypes.
12861279
*
12871280
* If there are multiple matching opfamilies, assume we can use any one to
12881281
* determine the logical relationship of the two operators and the correct
@@ -1321,12 +1314,9 @@ btree_predicate_proof(Expr *predicate, Node *clause, bool refute_it)
13211314
Form_pg_amoppred_form= (Form_pg_amop)GETSTRUCT(pred_tuple);
13221315
HeapTupleclause_tuple;
13231316

1324-
/*must be btree */
1317+
/*Must be btree */
13251318
if (pred_form->amopmethod!=BTREE_AM_OID)
13261319
continue;
1327-
/* predicate operator must be default within this opfamily */
1328-
if (pred_form->amoplefttype!=pred_form->amoprighttype)
1329-
continue;
13301320

13311321
/* Get the predicate operator's btree strategy number */
13321322
opfamily_id=pred_form->amopfamily;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp