model-writtenrun 164 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tender Wang reported that self-join elimination incorrectly reduced an inheritance scan joined to an ONLY scan from two result rows to one because it grouped references by relation OID despite their different scan scopes #1.
- Tender Wang proposed excluding references with rte->inh set, explaining that a parent's unique index does not establish uniqueness across its children and that preprocessing already clears the flag for ordinary tables without children #1.
- The attached patch tested both orders of the inheritance/ONLY join and verified that self-join elimination still worked when both references used ONLY #1.
- Tom Lane committed the proposed logic with expanded comments and without the regression tests in ebf82fae68, credited Tender Wang as author, and marked the fix for backpatching through PostgreSQL 18.
- Tom Lane closed the thread by confirming the push and explaining that the proposed tests were too heavyweight for a one-line change; the fix was landed with no further work raised #2.