> On Nov 19, 2026, at 04:52, Tomás Senart <[email protected]> wrote:
>
> Hi Chao,
>
> Thanks for the review. Both points are right, and v2 attached does both.
>
> 1. max_attnum is now an AttrNumber placed after the two bool fields,
> so it fits in the existing padding and CopyToStateData does not grow.
> 2. The slot_getsomeattrs() call in the else branch is gone.
> CopyOneRowTo() already deforms the needed prefix, so that branch now
> only sets copyslot = slot.
>
> With assertions enabled, the regress suite (243 tests) and the
> subscription TAP tests, including 031_column_list, pass. The code
> change is otherwise the same as v1.
>
> Regards,
> Tomás
> <v2-0001-Avoid-deforming-unused-trailing-columns-in-COPY-T.patch>
V2 looks good to me.
I just ran a simple performance test on my MacBook M4 with a 50-column table
containing 1 million rows, copying the first 3 columns, middle 3 columns, and
last 3 columns. The test shows some improvements:
```
Master (091b2926044) v2
First 3 columns 155ms 133ms
Middle 3 columns 156ms 140ms
Last 3 columns 157ms 159ms
```
The durations shown in the table are averages from multiple runs. The tests
were run with builds that had assertions and debugging disabled.
We can see that copying the first 3 columns and middle 3 columns shows a
noticeable performance improvement. When copying the last 3 columns, there is
little difference before and after the patch.
I ran the tests with builds disabling asserts and debug.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/