model-writtenrun 1755 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- jian he proposed direct COPY TO support for partitioned tables in #1, using table scans over descendant partitions to avoid query-execution overhead and reporting about a 7.7% improvement in a local benchmark.
- Melih Mutlu confirmed a speedup in #2 but demonstrated different output ordering in #5; David Rowley argued in #6 that matching SELECT order was unnecessary, provided rows from each partition remained consecutive.
- Nathan Bossart explained in #4 that this capability had previously been left out as a nonessential part of a much larger patch series, supporting revisiting it independently.
- The revised implementation in #7 added column-order mapping and regression tests, although jian he reported a slowdown when partition column order differed from the parent; #8 added the corresponding COPY documentation.
- vignesh C found that foreign partitions crashed the direct scan in #10, leading #11 to reject them explicitly and recommend the COPY (SELECT ...) TO variant.
- Following vignesh C's reviews in #13 and #15, jian he consolidated ordinary-table and partition scans into a shared helper in #14 and corrected the foreign-partition diagnostic in #16.
- Kirill Reshke reported benchmark gains that diminished with larger tables and requested multilevel coverage in #17; subsequent revisions added that coverage, simplified leaf creation, and moved the tests into copy.sql by #24.
- After Kirill Reshke accepted the test rationale in #27, jian he revisited the column-order slowdown in June and eliminated per-row root-slot allocation in #28, reporting that remapped partitions now also outperformed the query variant.
- Atsushi Torikoshi's reviews in #29 and #31 led to clearer documentation and helper naming, while #30 reused locks already acquired by BeginCopyTo and #32 added foreign-table error tests.
- Atsushi Torikoshi reported no ordinary-table performance regression and questioned unrelated test coverage in #33; Álvaro Herrera suggested partition-descriptor traversal in #34, but jian he's attempted replacement did not recurse through all levels, so find_all_inheritors remained in use as explained in #35.
- After the summer discussion and a roughly two-month pause, #40 incorporated Atsushi Torikoshi's documentation and variable-scope suggestions from #37, bringing the patch into its final review phase.
- Masahiko Sawada's review in #41 led #43 to simplify partition-list handling and scan branching and free attribute maps; Chao Li then identified partition-list ownership and cleanup concerns in #44.
- Masahiko Sawada supplied a cosmetic fix-up and requested tests for both matching and differing rowtypes in #46; jian he incorporated most of it, added partition-list cleanup, and introduced RLS support and tests in #50.
- The initial RLS implementation in #50 sorted by tableoid to imitate direct-scan ordering, but Masahiko Sawada demonstrated in #53 that this did not match breadth-first descendant traversal and argued that imposing an ordering guarantee added needless cost.
- jian he removed the RLS sort in #54 while retaining descendant access under row security, and deferred broader COPY error-path test coverage by dropping the standalone foreign-table test while keeping the foreign-partition test.
- Masahiko Sawada supplied another fix-up in #55 to use the already-open relation's relkind and polish comments and tests; jian he folded it into #56, correcting a comment typo along the way.
- Masahiko Sawada prepared the final attachment in #57 with documentation and commit-message edits, and it landed unchanged as 4bea91f21f, retaining jian he's authorship.
- The thread ends with Masahiko Sawada's push confirmation in #58; direct COPY TO support and RLS handling have landed, foreign partitions remain explicitly unsupported by the direct-scan path, and broader COPY test coverage was left for separate work.