Re: {heap,minimal}_expand_tuple() are unused

Поиск
Список
Период
Сортировка
Искать

Re: {heap,minimal}_expand_tuple() are unused

От:
Aleksander Alekseev <aleksander@tigerdata.com>
Дата:
Вложения:
Hi,

> Andres Freund  writes:
> >> Both heap_expand_tuple() and minimal_expand_tuple() being unused, make
> >> expand_tuple() unused in turn.
> >> I think we probably ought to remove all three in 20?  I didn't find external
> >> callers. It's nontrivial enough code that I don't think we should keep it
> >> around just because somebody might be using it.
>
> ... BTW, upon looking at the code coverage report to confirm these
> are unused, I noticed that the adjacent heap_copytuple_with_tuple is
> also unreferenced.

Today I re-discovered this fact and recalled this discussion. Here is
the patch in case it will speed-up things.

-- 
Best regards,
Aleksander Alekseev

Re: {heap,minimal}_expand_tuple() are unused

От:
Kyle Snavely <kjsnavely@gmail.com>
Дата:
Hello PG hackers,

I saw this Commitfest patch and thought it might be a good one for me to begin engaging with the PG community on through review. The patch removes `expand_tuple, heap_expand_tuple, minimal_expand_tuple, and heap_copytuple_with_tuple`.

I went ahead and checked out the PG master branch as of commit 6e70bef. I verified the patch contents do what is expected -- removing these functions and updating the test comments. I verified the patch applies cleanly to 6e70bef.

```
# On master
% git grep -n -w -e expand_tuple -e heap_expand_tuple -e minimal_expand_tuple -e heap_copytuple_with_tuple master
master:src/backend/access/common/heaptuple.c:703: *             heap_copytuple_with_tuple
master:src/backend/access/common/heaptuple.c:712:heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest)
master:src/backend/access/common/heaptuple.c:738:expand_tuple(HeapTuple *targetHeapTuple,
master:src/backend/access/common/heaptuple.c:962:minimal_expand_tuple(HeapTuple sourceTuple, TupleDesc tupleDesc)
master:src/backend/access/common/heaptuple.c:966:       expand_tuple(NULL, &minimalTuple, sourceTuple, tupleDesc);
master:src/backend/access/common/heaptuple.c:974:heap_expand_tuple(HeapTuple sourceTuple, TupleDesc tupleDesc)
master:src/backend/access/common/heaptuple.c:978:       expand_tuple(&heapTuple, NULL, sourceTuple, tupleDesc);
master:src/include/access/htup_details.h:809:extern void heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest);
master:src/include/access/htup_details.h:835:extern HeapTuple heap_expand_tuple(HeapTuple sourceTuple, TupleDesc tupleDesc);
master:src/include/access/htup_details.h:836:extern MinimalTuple minimal_expand_tuple(HeapTuple sourceTuple, TupleDesc tupleDesc);
master:src/test/regress/expected/fast_default.out:603:-- query to exercise expand_tuple function
master:src/test/regress/expected/fast_default.out:639:-- in expand_tuple, and that rows are correctly expanded for triggers
master:src/test/regress/sql/fast_default.sql:416:-- query to exercise expand_tuple function
master:src/test/regress/sql/fast_default.sql:432:-- in expand_tuple, and that rows are correctly expanded for triggers

# After the patch is applied
% git grep -n -w -e expand_tuple -e heap_expand_tuple -e minimal_expand_tuple -e heap_copytuple_with_tuple review-7284
# Nothing found
```

Next I built Postgres in a Debian trixie-slim container (on ARM), with most dependencies except docs and dtrace.

I ran a suite of tests with `meson test -C /build --print-errorlogs` which passes.
```
Ok:                 392
Expected Fail:      0
Fail:               0
Unexpected Pass:    0
Skipped:            36
Timeout:            0
```

All 36 skips are suites disabled by default: 35 gated behind PG_TEST_EXTRA, which I did not set, plus one Windows-only SSPI authentication test.

I did not encounter any issues while evaluating the patch.

Best,
Kyle

Re: {heap,minimal}_expand_tuple() are unused

От:
Aleksander Alekseev <aleksander@tigerdata.com>
Дата:
Вложения:
Hi Kyle,

> I did not encounter any issues while evaluating the patch.

Thanks for the review.

Here is the rebased patch.


--
Best regards,
Aleksander Alekseev

Re: {heap,minimal}_expand_tuple() are unused

От:
Andres Freund <andres@anarazel.de>
Дата:
Hi,

On 2026-11-11 12:01:13 +0300, Aleksander Alekseev wrote:
> Here is the rebased patch.

Thanks!  Pushed.

Greetings,

Andres


FAQ