diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-05-13 21:20:16 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-05-13 21:20:16 +0000 |
commit | 184e7a73a5b65b040d5c6413ec249a2b47f321e7 (patch) | |
tree | bcd27493e81f97ed534f0e5c6fab5e7e1f42890a /src/include/executor/execdebug.h | |
parent | 2979334d47c17e322c4cb10ad360cc0ee713700b (diff) | |
download | postgresql-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/execdebug.h')
-rw-r--r-- | src/include/executor/execdebug.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/include/executor/execdebug.h b/src/include/executor/execdebug.h index 58a987107de..9a6969ecefc 100644 --- a/src/include/executor/execdebug.h +++ b/src/include/executor/execdebug.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/execdebug.h,v 1.26 2005/03/16 21:38:09 tgl Exp $ + * $PostgreSQL: pgsql/src/include/executor/execdebug.h,v 1.27 2005/05/13 21:20:16 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -258,17 +258,14 @@ extern int NIndexTupleInserted; #define MJ2_printf(s, p1, p2) printf(s, p1, p2) #define MJ_debugtup(slot) debugtup(slot, NULL) #define MJ_dump(state) ExecMergeTupleDump(state) +#define MJ_DEBUG_COMPARE(res) \ + MJ1_printf(" MJCompare() returns %d\n", (res)) #define MJ_DEBUG_QUAL(clause, res) \ MJ2_printf(" ExecQual(%s, econtext) returns %s\n", \ - CppAsString(clause), T_OR_F(res)); - -#define MJ_DEBUG_MERGE_COMPARE(qual, res) \ - MJ2_printf(" MergeCompare(mergeclauses, %s, ...) returns %s\n", \ - CppAsString(qual), T_OR_F(res)); - + CppAsString(clause), T_OR_F(res)) #define MJ_DEBUG_PROC_NODE(slot) \ MJ2_printf(" %s = ExecProcNode(...) returns %s\n", \ - CppAsString(slot), NULL_OR_TUPLE(slot)); + CppAsString(slot), NULL_OR_TUPLE(slot)) #else @@ -278,8 +275,8 @@ extern int NIndexTupleInserted; #define MJ2_printf(s, p1, p2) #define MJ_debugtup(slot) #define MJ_dump(state) +#define MJ_DEBUG_COMPARE(res) #define MJ_DEBUG_QUAL(clause, res) -#define MJ_DEBUG_MERGE_COMPARE(qual, res) #define MJ_DEBUG_PROC_NODE(slot) #endif /* EXEC_MERGEJOINDEBUG */ |