model-writtenrun 9427 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Marcos Pegoraro reported that refreshing a subscription with roughly 10,000 tables stalled for hours and traced the problem to pg_publication_tables #1; returning months later with 15,000 tables, he showed that replacing its IN subquery with joins reduced a 45-minute query to one or two seconds #2.
- Fabrízio de Royes Mello proposed querying pg_publication_rel directly #3, while Tom Lane supplied an inline LATERAL rewrite because pg_get_publication_tables returns no duplicate OIDs #4; Marcos explained that his publication used ALL TABLES, preventing reliance on explicit publication membership alone #6.
- After confusion about replacing the system view, Fabrízio tested Tom’s inline rewrite and demonstrated that PostgreSQL 11.3 required allow_system_table_mods #10; Tom corrected his earlier advice, explaining that only development HEAD had relaxed that restriction #11.
- Tom posted the complete view rewrite and regression-output update, measured a reduction from about 360 ms to 6 ms on the regression database, and proposed including the fix in PostgreSQL 12 alongside an already anticipated catalog-version bump #12; Fabrízio supported that release timing #13.
- Tom committed the attached patch unchanged apart from the catalog-version bump as 166f69f769, crediting the original report and fix suggestion.
- After the commit, Peter Eisentraut confirmed that there was no underlying reason to retain the original subquery and that he had simply missed the LATERAL alternative #14; the sole attached patch had landed, with no further revision pending in the thread.