Self-join elimination
Planner removal of redundant inner self joins on unique keys, and its wrong-result fixes.
Versions
- PostgreSQL 20 · worked-on · improved · moderate
- PostgreSQL 19 · worked-on · new · major
- PostgreSQL 18 · shipped · new · major · 4 commits · +3k / -177 lines
- PostgreSQL 17 · reverted · new · major · 6 commits · +3k / -433 lines
- PostgreSQL 16 · worked-on · new · major
- PostgreSQL 15 · worked-on · new · major
- PostgreSQL 14 · worked-on · new · major
- PostgreSQL 13 · worked-on · new · major
- PostgreSQL 12 · shipped · new · major · 1 commit · +22 / -13 lines
- PostgreSQL 11 · worked-on · new · major
Threads
- Simplify the uniqueness proof for self-join elimination
- BUG #19800: Wrong results: self-join elimination drops an ORDER BY sort key with GROUPING SETS / CUBE / ROLLUP
- BUG #19861: Self-join elimination drops a VOLATILE predicate and changes the query result
- Remove unused arguments from split_selfjoin_quals()
- BUG #19805: Wrong results: self-join elimination drops an ORDER BY sort key with GROUPING SETS / CUBE / ROLLUP
- BUG #19799: Self-join elimination: "failed to build any 3-way joins" with LATERAL
- [PATCH] Prevent lateral dependency cycles in self-join elimination
- Self-join elimination discards differing row lock wait policies
- Wrong results from self-join elimination with different restriction operators
- Wrong results from self-join elimination with inheritance and ONLY
- [PG19] Stale state after the join removal restart gives wrong results
- remove_useless_joins vs. bug #19560
- BUG #19710: Incorrect DELETE result after LEFT JOIN optimization
- BUG #19626: Segmentation fault planning self-join IN subquery with LATERAL UNION ALL
- Extending Self-Join Elimination to partitioned tables
- BUG #19435: Error: "No relation entry for relid 2" Triggered by Complex Join with Self-Referencing Tables
- Self-join elimination drops an equality qual
- BUG #19560: Wrong results since v16: removable LEFT JOIN silently drops WHERE qual
- Discarded adjust_relid_set() return values in remove_self_join_rel
- The bogus calls in remove_self_join_rel()
- [PATCH] Allow SJE to recognize GiST-backed temporal primary keys
- Clean up remove_rel_from_query() after self-join elimination commit
- Correction of RowMark Removal During Sel-Join Elimination
- Fix comments for ChangeVarNodes() and related functions
- [BUG] Remove self joins causes 'variable not found in subplan target lists' error
- Removing unneeded self joins
- Some problems regarding the self-join elimination code
- Revert: Remove useless self-joins *and* -DREALLOCATE_BITMAPSETS make server crash, regress test fail.
- BUG #18260: Unexpected error: "negative bitmapset member not allowed" triggered by multiple JOIN
- BUG #18261: Inconsistent results of SELECT affected by joined subqueries
- Fix error of negative bitmapset member
- Failed assertion in joininfo.c, remove_join_clause_from_rels
- Assert failure on 'list_member_ptr(rel->joininfo, restrictinfo)'
- BUG #18187: Unexpected error: "variable not found in subplan target lists" triggered by JOIN
- BUG #18170: Unexpected error: no relation entry for relid 3
- Implement hook for self-join simplification
- Self-join optimisation