aboutsummaryrefslogtreecommitdiff
path: root/src/include/executor/execdefs.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-05-13 21:20:16 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-05-13 21:20:16 +0000
commit184e7a73a5b65b040d5c6413ec249a2b47f321e7 (patch)
treebcd27493e81f97ed534f0e5c6fab5e7e1f42890a /src/include/executor/execdefs.h
parent2979334d47c17e322c4cb10ad360cc0ee713700b (diff)
downloadpostgresql-184e7a73a5b65b040d5c6413ec249a2b47f321e7.tar.gz
postgresql-184e7a73a5b65b040d5c6413ec249a2b47f321e7.zip
Revise nodeMergejoin in light of example provided by Guillaume Smet.
When one side of the join has a NULL, we don't want to uselessly try to match it against every remaining tuple of the other side. While at it, rewrite the comparison machinery to avoid multiple evaluations of the left and right input expressions and to use a btree comparator where available, instead of double operator calls. Also revise the state machine to eliminate redundant comparisons and hopefully make it more readable too.
Diffstat (limited to 'src/include/executor/execdefs.h')
-rw-r--r--src/include/executor/execdefs.h28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/include/executor/execdefs.h b/src/include/executor/execdefs.h
index 100049fdf83..e8ef7a47fd0 100644
--- a/src/include/executor/execdefs.h
+++ b/src/include/executor/execdefs.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/executor/execdefs.h,v 1.17 2004/12/31 22:03:29 pgsql Exp $
+ * $PostgreSQL: pgsql/src/include/executor/execdefs.h,v 1.18 2005/05/13 21:20:16 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -18,20 +18,16 @@
* Merge Join states
* ----------------
*/
-#define EXEC_MJ_INITIALIZE 1
-#define EXEC_MJ_JOINMARK 2
-#define EXEC_MJ_JOINTEST 3
-#define EXEC_MJ_JOINTUPLES 4
-#define EXEC_MJ_NEXTOUTER 5
-#define EXEC_MJ_TESTOUTER 6
-#define EXEC_MJ_NEXTINNER 7
-#define EXEC_MJ_SKIPOUTER_BEGIN 8
-#define EXEC_MJ_SKIPOUTER_TEST 9
-#define EXEC_MJ_SKIPOUTER_ADVANCE 10
-#define EXEC_MJ_SKIPINNER_BEGIN 11
-#define EXEC_MJ_SKIPINNER_TEST 12
-#define EXEC_MJ_SKIPINNER_ADVANCE 13
-#define EXEC_MJ_ENDOUTER 14
-#define EXEC_MJ_ENDINNER 15
+#define EXEC_MJ_INITIALIZE_OUTER 1
+#define EXEC_MJ_INITIALIZE_INNER 2
+#define EXEC_MJ_JOINTUPLES 3
+#define EXEC_MJ_NEXTOUTER 4
+#define EXEC_MJ_TESTOUTER 5
+#define EXEC_MJ_NEXTINNER 6
+#define EXEC_MJ_SKIP_TEST 7
+#define EXEC_MJ_SKIPOUTER_ADVANCE 8
+#define EXEC_MJ_SKIPINNER_ADVANCE 9
+#define EXEC_MJ_ENDOUTER 10
+#define EXEC_MJ_ENDINNER 11
#endif /* EXECDEFS_H */