Outer-join aware Vars
Planner rework marking Vars and PlaceHolderVars with the outer joins that can null them, fixing outer-join planning bugs.
Versions
- PostgreSQL 20 · worked-on · improved · minor
- PostgreSQL 19 · worked-on · improved · moderate
- PostgreSQL 18 · shipped · improved · moderate · 2 commits · +561 / -26 lines
- PostgreSQL 17 · worked-on · improved · moderate
- PostgreSQL 16 · worked-on · improved · moderate
Threads
- [BUG] Planner bug causes incorrect query results in PG14 and PG15
- A gap in preventing bogus parameterizations in a798660ebe3
- Eliminate redundant outer-join clone clauses after constant propagation
- ERROR: failed to assign all NestLoopParams to plan nodes
- BUG #19765: Wrong result from a chain of LEFT JOINs since v16
- Assert failure in try_nestloop_path()
- Dead-end joins from LATERAL references across outer joins
- BUG #19787: "could not find pathkey item to sort" for Gather Merge over a merge join below reordered LEFT JOINs
- ERROR: failed to apply nullingrels to a non-Var
- "failed to build any N-way joins" from a five-relation query
- ERROR: unsupported join alias expression
- Assert failure in get_baserel_parampathinfo with lateral UNION ALL
- BUG #19553: Wrong results from nested LEFT JOINs over an empty subquery (regression since v16)
- Use exact nullingrels matches for NestLoopParams
- BUG #19412: Wrong query result with not null constraint
- Retiring is_pushed_down
- Remove no-op PlaceHolderVars
- BUG #19046: Incorrect result when using json_array() with column reference in subquery combined with RIGHT JOIN
- BUG #18953: Planner fails to build plan for complex query with LATERAL references
- Join removal and attr_needed cleanup
- Problems with estimating OR conditions, IS NULL on LEFT JOINs
- The varnullingrels bitmapset is not only about outer joins
- Query result differences between PostgreSQL 17 vs 16
- BUG #18803: ERROR: wrong varnullingrels (b) (expected (b 4)) for Var 2/1
- ERROR: corrupt MVNDistinct entry
- Avoid unnecessary wrapping for more complex expressions
- An inefficient query caused by unnecessary PlaceHolderVar
- Inconsistent RestrictInfo serial numbers
- BUG #18627: Regression (15 -> 16) - Join removal not performed when join condition spans multiple tables
- Significant Execution Time Difference Between PG13.14 and PG16.4 for Query on information_schema Tables.
- A wrong comment about search_indexed_tlist_for_var
- BUG #18429: Inconsistent results on similar queries with join lateral
- BUG #18284: Filter in left lateral join not respected
- Fix bogus Asserts in calc_non_nestloop_required_outer
- BUG #18188: wrong varnullingrels
- BUG #18184: ERROR: wrong varnullingrels (b) (expected (b 3)) for Var 2/2
- Introduce join_info_array for direct lookups of SpecialJoinInfo by ojrelid
- Making Vars outer-join aware
- Assert !bms_overlap(joinrel->relids, required_outer)
- BUG #17986: Inconsistent results of SELECT affected by btree index
- BUG #17978: Unexpected error: "wrong varnullingrels (b) (expected (b 5)) for Var 6/2" triggered by JOIN
- BUG #17975: Nested Loop Index Scan returning wrong result
- BUG #17976: Inconsistent results of SELECT using CASE WHEN clause
- ERROR: wrong varnullingrels (b 3) (expected (b)) for Var 2/1
- BUG #17982: Inconsistent results of SELECT with CTE caused by subquery comparison
- ERROR: no relation entry for relid 6
- Assert failure of the cross-check for nullingrels
- Wrong results due to missing quals
- Clause accidentally pushed down ( Possible bug in Making Vars outer-join aware)
- ERROR: wrong varnullingrels (b 5 7) (expected (b)) for Var 3/3
- v16 regression - wrong query results with LEFT JOINs + join removal
- BUG #17832: ERROR: failed to apply nullingrels to a non-Var in HEAD
- Wrong query results caused by loss of join quals
- Inconsistent nullingrels due to oversight in deconstruct_distribute_oj_quals
- BUG #17781: Assert in setrefs.c
- A bug in make_outerjoininfo
- BUG #17769: Assert triggered in indxpath.c
- pgsql: Remove over-optimistic Assert.