Fix an old corner-case error in match_unsorted_outer(): don't consider
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 5 Feb 2009 01:24:55 +0000 (01:24 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 5 Feb 2009 01:24:55 +0000 (01:24 +0000)
commitfc058be2773475e1e3c2aee6228368b71d2772be
treede5f8d471d9e1e52caf68544406eac9cb0be103e
parent711b1f1e2f6167f6be82b3ab5ce680996018b3a1
Fix an old corner-case error in match_unsorted_outer(): don't consider
the cheapest-total inner path as a new candidate while truncating the
sort key list, if it already matched the full sort key list.  This is
too much of a corner case to be worth back-patching, since it's unusual
for the cheapest total path to be sorted, and anyway no real harm is
done (except in JOIN_SEMI/ANTI cases where cost_mergejoin is a bit
broken at the moment).  But it wasn't behaving as intended, so fix it.
Noted while examining a test case from Kevin Grittner.  This error doesn't
explain his issue, but it does explain why "set enable_seqscan = off"
seemed to reproduce it for me.
src/backend/optimizer/path/joinpath.c