model-writtenrun 3144 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Richard Guo reported an assertion failure for chained partitionwise left joins and proposed deriving child-join relids from the parent with adjust_child_relids(), because add_outer_joins_to_relids() compares against parent-level join information #1.
- Tom Lane accepted that approach and committed f75595cd80 from #1, expanding comments and moving the regression case to partition_join.sql to reuse existing tables, as explained in #2.
- Ashutosh Bapat then reported increased planner memory consumption with thousands of partitions and supplied a separate optimization that computes AppendRelInfo arrays once, reuses them, and frees temporary bitmapsets, together with a diagnostic EXPLAIN helper #4.
- Ashutosh also identified inefficient bitmapset representation for sparse, large relids, but explicitly left that broader redesign outside this thread and his immediate plans #4.
- Ashutosh refreshed the diagnostic helper and maintained the optimization through #6 and #7, then dropped the helper as no longer necessary while rebasing the optimizer patch in #8.
- After David Christensen questioned whether another optimization had already solved the problem #9, Ashutosh explained the distinction and supplied a rebased patch with measurements showing about 95 MB saved for a five-way join of tables with 1,000 partitions each #10.
- Additional measurements for smaller partition counts showed smaller memory savings #11, but Robert Haas challenged the apparent odd-versus-even pattern in planning-time changes #12.
- Ashutosh repeated the timing experiments and reported that the differences generally fell within measurement variation, without an odd-versus-even bias #13; Robert accepted the explanation while asking for stable measurements before publication #14.
- David reviewed the code and endorsed the reuse of computed information as a sensible improvement with minimal code changes #15.
- Richard reviewed the optimization and requested consistent types, parameter ordering, cleanup ordering, and an explanation of eager freeing #18; Ashutosh supplied the previous patch plus a delta addressing those comments #19.
- Richard consolidated the series and polished its comments and commit message in #20, then committed it as 513f4472a4 with one further comment-only edit and confirmed the push in #21.
- The thread ended with Ashutosh's acknowledgment #22, leaving both the assertion fix and the targeted memory optimization committed, with no submitted patch still awaiting review.