mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +03:00
Add the ability to extract OR indexscan conditions from OR-of-AND
join conditions in which each OR subclause includes a constraint on the same relation. This implements the other useful side-effect of conversion to CNF format, without its unpleasant side-effects. As per pghackers discussion of a few weeks ago.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/optimizer/path/joinpath.c,v 1.84 2003/12/30 23:53:14 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/optimizer/path/joinpath.c,v 1.85 2004/01/05 05:07:35 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -690,7 +690,7 @@ hash_inner_and_outer(Query *root,
|
||||
{
|
||||
RestrictInfo *restrictinfo = (RestrictInfo *) lfirst(i);
|
||||
|
||||
if (!restrictinfo->canjoin ||
|
||||
if (!restrictinfo->can_join ||
|
||||
restrictinfo->hashjoinoperator == InvalidOid)
|
||||
continue; /* not hashjoinable */
|
||||
|
||||
@ -698,7 +698,7 @@ hash_inner_and_outer(Query *root,
|
||||
* If processing an outer join, only use its own join clauses for
|
||||
* hashing. For inner joins we need not be so picky.
|
||||
*/
|
||||
if (isouterjoin && restrictinfo->ispusheddown)
|
||||
if (isouterjoin && restrictinfo->is_pushed_down)
|
||||
continue;
|
||||
|
||||
/*
|
||||
@ -804,17 +804,17 @@ select_mergejoin_clauses(RelOptInfo *joinrel,
|
||||
*/
|
||||
if (isouterjoin)
|
||||
{
|
||||
if (restrictinfo->ispusheddown)
|
||||
if (restrictinfo->is_pushed_down)
|
||||
continue;
|
||||
switch (jointype)
|
||||
{
|
||||
case JOIN_RIGHT:
|
||||
if (!restrictinfo->canjoin ||
|
||||
if (!restrictinfo->can_join ||
|
||||
restrictinfo->mergejoinoperator == InvalidOid)
|
||||
return NIL; /* not mergejoinable */
|
||||
break;
|
||||
case JOIN_FULL:
|
||||
if (!restrictinfo->canjoin ||
|
||||
if (!restrictinfo->can_join ||
|
||||
restrictinfo->mergejoinoperator == InvalidOid)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
@ -826,7 +826,7 @@ select_mergejoin_clauses(RelOptInfo *joinrel,
|
||||
}
|
||||
}
|
||||
|
||||
if (!restrictinfo->canjoin ||
|
||||
if (!restrictinfo->can_join ||
|
||||
restrictinfo->mergejoinoperator == InvalidOid)
|
||||
continue; /* not mergejoinable */
|
||||
|
||||
|
Reference in New Issue
Block a user