aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/path/mergeutils.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>1999-03-01 00:10:44 +0000
committerTom Lane <tgl@sss.pgh.pa.us>1999-03-01 00:10:44 +0000
commitb204d10c79b5177026565a0db531a86f585f09f4 (patch)
treed16f429f5adb8eae6cef113ea730af6fc21771f0 /src/backend/optimizer/path/mergeutils.c
parentd077c6149269701d0831634e8800b53c528d13ac (diff)
downloadpostgresql-b204d10c79b5177026565a0db531a86f585f09f4.tar.gz
postgresql-b204d10c79b5177026565a0db531a86f585f09f4.zip
Executor no longer cares about mergejoinop, mergerightorder, mergeleftorder,
so remove them from MergeJoin node. Hack together a partial solution for commuted mergejoin operators --- yesterday a mergejoin int4 = int8 would crash if the planner decided to commute it, today it works. The planner's representation of mergejoins really needs a rewrite though. Also, further testing of mergejoin ops in opr_sanity regress test.
Diffstat (limited to 'src/backend/optimizer/path/mergeutils.c')
-rw-r--r--src/backend/optimizer/path/mergeutils.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/backend/optimizer/path/mergeutils.c b/src/backend/optimizer/path/mergeutils.c
index 7d0009c3e8b..5f5a11bc787 100644
--- a/src/backend/optimizer/path/mergeutils.c
+++ b/src/backend/optimizer/path/mergeutils.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/mergeutils.c,v 1.19 1999/02/15 03:22:06 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/mergeutils.c,v 1.20 1999/03/01 00:10:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -27,6 +27,14 @@
* it within a mergeinfo node containing other clause nodes with the same
* mergejoin ordering.
*
+ * XXX This is completely braindead: there is no reason anymore to segregate
+ * mergejoin clauses by join operator, since the executor can handle mergejoin
+ * clause sets with different operators in them. Instead, we ought to be
+ * building a MergeInfo for each potentially useful ordering of the input
+ * relations. But right now the optimizer's internal data structures do not
+ * support that (MergeInfo can only store one MergeOrder for a set of clauses).
+ * Something to fix next time...
+ *
* 'restrictinfo_list' is the list of restrictinfo nodes
* 'inner_relid' is the relid of the inner join relation
*
@@ -38,7 +46,7 @@ group_clauses_by_order(List *restrictinfo_list,
int inner_relid)
{
List *mergeinfo_list = NIL;
- List *xrestrictinfo = NIL;
+ List *xrestrictinfo;
foreach(xrestrictinfo, restrictinfo_list)
{
@@ -84,10 +92,10 @@ group_clauses_by_order(List *restrictinfo_list,
mergeinfo_list);
}
- ((JoinMethod *) xmergeinfo)->clauses = lcons(clause,
- ((JoinMethod *) xmergeinfo)->clauses);
- ((JoinMethod *) xmergeinfo)->jmkeys = lcons(jmkeys,
- ((JoinMethod *) xmergeinfo)->jmkeys);
+ xmergeinfo->jmethod.clauses = lcons(clause,
+ xmergeinfo->jmethod.clauses);
+ xmergeinfo->jmethod.jmkeys = lcons(jmkeys,
+ xmergeinfo->jmethod.jmkeys);
}
}
return mergeinfo_list;