model-writtenrun 5565 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- bucoo@sohu.com reported an unnecessarily expensive UNION plan and proposed dividing SubqueryScan costs and row estimates among parallel workers, changing the expected plan to Gather above Parallel Append in #1.
- Robert Haas questioned the parallel adjustment in #2 and #6, while Richard Guo explained that the relevant SubqueryScan nodes disappear during setrefs processing and confirmed that the preferable path loses on estimated cost in #3.
- bucoo@sohu.com demonstrated that SubqueryScan retained the full relation row count above a partial subpath and proposed copying the subpath estimate in #7, but Robert's questions in #8 and bucoo's filter checks in #9 established that copying alone would ignore SubqueryScan filters.
- Robert clarified how parallel-safe nodes propagate worker-local rows in #13; David G. Johnston tested the direct-copy approach and reported both the desired parallel plan and incorrect filtered estimates in #14, while Richard further analyzed the same row-count problem in #15.
- Tom Lane initially investigated charges for SubqueryScan nodes that would later be removed in #19, then showed that eliminating those charges alone did not fix plan selection because inflated row counts also inflated Parallel Append overhead in #20.
- Tom chose to calculate SubqueryScan output rows from the subpath estimate and qualifier selectivity in #22, supplying the replacement patch in #23; avoiding charges for subsequently removed SubqueryScans remained a separate improvement.
- David confirmed that the replacement fixed the observed problem in #24, and Robert reviewed it while suggesting a broader multiplier-based estimation model in #25; Tom favored the targeted fix and explained the complications of parameterized selectivity in #26.
- Robert cautioned against backpatching plan changes in #27, Tom deferred broader EXPLAIN redesign to PostgreSQL 16 or later in #28, and Robert raised no objection to the PostgreSQL 15 fix in #29.
- Tom committed #23 as c40ba5f318 with an additional correction charging CPU work against subpath rows rather than full-relation tuples, announcing in #30 that regression results remained unchanged.
- The thread ended with the targeted fix landed and no backpatch planned because stable-branch plan changes could be unwelcome, as explained in c40ba5f318; the broader costing and EXPLAIN improvements discussed in #22 and #28 remained outside this change.