postgresql/src
Tom Lane 1007b0a126 Fix hashjoin costing mistake introduced with inner_unique optimization.
In final_cost_hashjoin(), commit 9c7f5229a allowed inner_unique cases
to follow a code path previously used only for SEMI/ANTI joins; but it
neglected to fix an if-test within that path that assumed SEMI and ANTI
were the only possible cases.  This resulted in a wrong value for
hashjointuples, and an ensuing bad cost estimate, for inner_unique normal
joins.  Fortunately, for inner_unique normal joins we can assume the number
of joined tuples is the same as for a SEMI join; so there's no need for
more code, we just have to invert the test to check for ANTI not SEMI.

It turns out that in two contrib tests in which commit 9c7f5229a
changed the plan expected for a query, the change was actually wrong
and induced by this estimation error, not by any real improvement.
Hence this patch also reverts those changes.

Per report from RK Korlapati.  Backpatch to v10 where the error was
introduced.

David Rowley

Discussion: https://postgr.es/m/CA+SNy03bhq0fodsfOkeWDCreNjJVjsdHwUsb7AG=jpe0PtZc_g@mail.gmail.com
2018-07-14 11:59:12 -04:00
..
backend Fix hashjoin costing mistake introduced with inner_unique optimization. 2018-07-14 11:59:12 -04:00
bin Dump foreign keys on partitioned tables 2018-07-13 13:13:26 -04:00
common Fix more wrong paths in header comments 2018-07-11 17:57:04 +03:00
fe_utils Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00
include Fix argument of pg_create_logical_replication_slot for slot name 2018-07-13 09:32:12 +09:00
interfaces Fix more wrong paths in header comments 2018-07-11 17:57:04 +03:00
makefiles Remove Windows module-list-dumping code. 2018-04-30 13:20:13 -04:00
pl Prohibit transaction commands in security definer procedures 2018-07-13 10:41:32 +02:00
port Rethink how to get float.h in old Windows API for isnan/isinf 2018-07-11 09:11:48 -04:00
template Force "restrict" not to be used when compiling with xlc. 2017-10-13 12:15:06 -07:00
test Fix crash in json{b}_populate_recordset() and json{b}_to_recordset(). 2018-07-13 14:16:54 -04:00
timezone Update time zone data files to tzdata release 2018e. 2018-05-09 13:56:22 -04:00
tools Update documentation editor setup instructions 2018-07-13 21:23:41 +02:00
tutorial Update copyright for 2018 2018-01-02 23:30:12 -05:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Un-break contrib install with llvm. 2018-04-28 14:45:39 -04:00
Makefile.shlib Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-04-03 16:26:05 -04:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00