model-writtenrun 2343 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Mar 2022 · 2 entries
- Yuya Watari began with a proof of concept for quadratic planning slowdown on heavily partitioned tables, using relids-keyed hash tables and a separate non-child member list to avoid repeated EquivalenceMember scans #1.
- David Rowley initially suggested hashing expressions, but Yuya explained that relid predicates were the measured bottleneck, and Tom Lane warned about small-query overhead and exponential subset enumeration while suggesting relation-based member lookup #2 #3 #4.
Jun - Dec 2022 · 6 entries
- David proposed a global member list with Bitmapset indexes and supplied an initial implementation; Yuya then fixed its bugs and implemented indexed filtering, reporting substantial speedups #8 #10 #11.
- David explained that a changed regression plan exposed pre-existing duplicate-qual behavior rather than requiring preservation of member order, then revised the lookup helpers and extended indexing to source and derived RestrictInfos #12 #13.
- Small-query regressions led Yuya to add ECIndexCache, while David proposed adaptive iterators; Yuya compared sibling cache and iterator experiments and reverted an optimization whose setup cost outweighed its benefit #14 #15 #17.
- Yuya next tried a simpler small-case fallback without the cache, then fixed a postgres_fdw subset check that Andrey Lepikhov showed could not safely be replaced by an assertion #18 #23 #28.
- David restored ordinary member lists alongside indexes, introduced adaptive iterators and a separate bitmap-intersection improvement, then adjusted non-child scans after Yuya's benchmarks showed remaining regressions #29 #33 #34.
- Thom Brown reported dramatic gains on deeply partitioned tables but corrected his initial results after accounting for prepared statements switching to generic plans, leaving substantial but smaller measured improvements #27 #30 #32.
Jan - Mar 2023 · 3 entries
- New cross-checks comparing indexed and linear iteration exposed empty-relids and variable-free-member bugs; Yuya supplied fixes, and David produced an alternative consolidated revision using explicit member metadata #35 #36 #37.
- Changes involving outer-join relids exposed null RelOptInfos, so Yuya moved indexes into PlannerInfo and then, on Andrey's advice, into RangeTblEntry #38 #39 #40.
- Bitmapset improvements moved into separate development, while the remaining optimizer series was refreshed after a long gap and gained member indexes needed by relation-removal code #42 #43 #44.
Jul - Sep 2023 · 4 entries
- Andrey and Ashutosh Bapat confirmed large production-build speedups but found expensive assertion checking and increased memory use, prompting discussion of cheaper validation and more economical structures #46 #48 #49 #59.
- David rejected planner-only indexes in serialized RangeTblEntries and raised concerns about child-member semantics and order-dependent lookup, asking that parent translation be explored before committing the bitmap design #59 #61.
- Yuya rewrote the main optimization so ec_members held only parent members, child members lived in RelOptInfos, and searches used parent-relid translation; RestrictInfo indexing remained a separate part of the series #63.
- Self-join-removal discussion exposed the difficulty of maintaining global positional indexes when removing restrictions, and Alena Rybakina subsequently rebased the series and repaired self-join-removal and atomic-function serialization problems #65 #68 #70 #73.
Nov 2023 - Mar 2024 · 2 entries
- Yuya refined Alena's changes to reuse RestrictInfos, then introduced update_clause_relids() and reference cleanup to keep indexes synchronized; Alena confirmed the corrected assertion checks worked #77 #79 #80.
- The next consolidation introduced a child-member iterator and moved RestrictInfo indexes out of RangeTblEntry into PlannerInfo, but Ashutosh's benchmarks still showed memory growth and assertion-build slowdowns #81 #82.
Aug 2024 - Apr 2025 · 16 entries
- After another long gap, Yuya updated the series for set-operation child members and clarified parent-member insertion, followed by maintenance rebases #86 #87 #88.
- Dmitry Dolgov requested clearer comments, fresh benchmarks and evidence for branch-prediction hints; Yuya's measurements showed the hints were unhelpful or harmful, so their removal became part of the series #89 #90.
- Ashutosh renewed the memory concern, while Alvaro Herrera urged prioritizing production behavior over assertion-build timing; Yuya then introduced a RestrictInfo iterator that avoided temporary Bitmapset allocation, trading some large-query speed for substantially lower memory use #91 #95 #96 #98.
- Yuya added inverted indexes for child joinrels to recover a missed performance case, consolidated the patches, and then centralized parent translation and child selection inside iterator setup to reduce duplicated caller code #99 #100.
- David resumed detailed review in March 2025, questioning redundant parent metadata and unclear iterator contracts; Yuya simplified the metadata, improved naming and documentation, and separated PlannerInfo parameter plumbing into a precursor patch #104 #105 #106 #107.
- David found a list-memory leak and questioned whether the RestrictInfo work could be ready for PostgreSQL 18; Ashutosh measured the leak and supplied a complete series with a list_free() fix #108 #110 #111.
- Tom objected to RelOptInfo child storage, circular member-to-class links and complicated global indexes, proposing per-EquivalenceClass arrays of child-member lists instead; Yuya initially expected to defer the redesign to PostgreSQL 19 #109 #112 #113.
- David implemented Tom's array-based design and dropped the RestrictInfo patches from the immediate submission because competing work might solve that problem, preserving a chance to land the main optimization in PostgreSQL 18 #115.
- Benchmarking of the simpler design showed strong planning gains with little memory overhead, while review addressed child-array output, lifecycle assertions and documentation #116 #118 #119 #121.
- Tom removed the now-unnecessary PlannerInfo dependency and precursor patch, and David added safe array expansion and clearer iterator control flow #122 #123.
- David resolved duplicate child-join iteration by storing each member in one component-relid slot, backed by diagnostic testing; Yuya and Tom approved that revision #124 #125 #126.
- Ashutosh's final review prompted clearer iterator contracts and foreach_node() conversions, while David explained why differing caller predicates should remain outside the iterator; Tom and Ashutosh supported proceeding #127 #128 #129 #130.
- David committed the final attached optimization as d69d45a5a9, with only a small comment addition and commit-message edits after #128, and reported further benchmarks showing gains up to about sixtyfold #131.
- David marked the CommitFest entry committed and explained that separate upstream work probably superseded derived-clause indexing, leaving any remaining benefit from indexing ec_sources to be demonstrated in a new proposal #134.
- Amit Langote then questioned the optimizer README wording; discussion favored preserving its high-level description, and David proposed the inline change from 'should ignore' to 'needn't look at' child members, which Amit accepted #135 #136 #137 #138 #139 #140 #141.
- The README clarification landed as d7c04db27a, and the thread ended with its push announcement and acknowledgment; the child-member optimization was complete, while possible remaining RestrictInfo work required separate follow-up #142 #143 #134.