Thread: pgsql: Revise nodeMergejoin in light of example provided by Guillaume

pgsql: Revise nodeMergejoin in light of example provided by Guillaume

From
tgl@svr1.postgresql.org (Tom Lane)
Date:
Log Message:
-----------
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.

Modified Files:
--------------
    pgsql/src/backend/executor:
        nodeMergejoin.c (r1.71 -> r1.72)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeMergejoin.c.diff?r1=1.71&r2=1.72)
    pgsql/src/include/executor:
        execdebug.h (r1.26 -> r1.27)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/execdebug.h.diff?r1=1.26&r2=1.27)
        execdefs.h (r1.17 -> r1.18)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/execdefs.h.diff?r1=1.17&r2=1.18)
    pgsql/src/include/nodes:
        execnodes.h (r1.131 -> r1.132)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/execnodes.h.diff?r1=1.131&r2=1.132)