Revert: Remove useless self-joins This commit reverts d3d55ce5713 and subsequent fixes 2b26a694554, 93c85db3b5b, b44a1708abe, b7f315c9d7d, 8a8ed916f73, b5fb6736ed3, 0a93f803f45, e0477837ce4, a7928a57b9f, 5ef34a8fc38, 30b4955a466, 8c441c08279, 028b15405b4, fe093994db4, 489072ab7a9, and 466979ef031.
We are quite late in the release cycle and new bugs continue to appear. Even though we have fixes for all known bugs, there is a risk of throwing many bugs to end users. The plan for self-join elimination would be to do more review and testing, then re-commit in the early v18 cycle. Reported-by: Tom Lane Discussion: https://postgr.es/m/2422119.1714691974%40sss.pgh.pa.us Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/d1d286d83c0eed695910cb20d970ea9bea2e5001 Modified Files -------------- doc/src/sgml/config.sgml | 16 - src/backend/optimizer/path/indxpath.c | 39 - src/backend/optimizer/plan/analyzejoins.c | 1284 ++--------------------------- src/backend/optimizer/plan/planmain.c | 5 - src/backend/utils/misc/guc_tables.c | 10 - src/include/nodes/pathnodes.h | 35 +- src/include/optimizer/paths.h | 3 - src/include/optimizer/planmain.h | 6 - src/test/regress/expected/equivclass.out | 30 - src/test/regress/expected/join.out | 1032 ----------------------- src/test/regress/expected/sysviews.out | 3 +- src/test/regress/sql/equivclass.sql | 16 - src/test/regress/sql/join.sql | 470 ----------- src/tools/pgindent/typedefs.list | 3 - 14 files changed, 69 insertions(+), 2883 deletions(-)