[PATCH] The heap_getsysattr function deletes unused parameters

Started by lei yang2 months ago4 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

appliessuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t253086
psql -h localhost -U postgres

Built from patchset v1 (message #1), September 20, 2026 at 06:26 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t253086_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t253086_1 && git checkout t253086_1

Patchset v1 (message #1) is on t253086_1

Jump to latest
#1lei yang
yanglei.ovo@gmail.com

hi,

The tupleDesc parameter in the heap_getsysattr function is not used,
and the TupleDesc structure does not contain system attributes.
Maybe we can delete the parameter tupleDesc.

Attachments:

t253086_1
0001-The-heap_getsysattr-function-deletes-unused-paramete.patchapplication/octet-stream; name=0001-The-heap_getsysattr-function-deletes-unused-paramete.patchDownload+6-11
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: lei yang (#1)
Re: [PATCH] The heap_getsysattr function deletes unused parameters

lei yang <yanglei.ovo@gmail.com> writes:

The tupleDesc parameter in the heap_getsysattr function is not used,
and the TupleDesc structure does not contain system attributes.
Maybe we can delete the parameter tupleDesc.

I do not think this is a great idea. We don't use the tupdesc today
perhaps, but it's plausible that it'd be needed in the future.
Different table AMs might have different sets of system columns.

Unless you can show a measurable performance gain from this change,
we should leave it alone.

regards, tom lane

#3Michael Paquier
michael@paquier.xyz
In reply to: Tom Lane (#2)
Re: [PATCH] The heap_getsysattr function deletes unused parameters

On Wed, Jul 15, 2026 at 11:53:40AM -0400, Tom Lane wrote:

I do not think this is a great idea. We don't use the tupdesc today
perhaps, but it's plausible that it'd be needed in the future.
Different table AMs might have different sets of system columns.

Unless you can show a measurable performance gain from this change,
we should leave it alone.

One thing that may make this removal worth it would be to look at if
heap_getsysattr() is used in some extension outside of the core code
and see if these removals lead to some simplifications with the
TupleDescs involved (say for example less locks required). The
in-core callers of heap_getsysattr() don't make that perspective
really attractive.
--
Michael

#4lei yang
yanglei.ovo@gmail.com
In reply to: Tom Lane (#2)
Re: [PATCH] The heap_getsysattr function deletes unused parameters

Tom Lane <tgl@sss.pgh.pa.us> writes:

I do not think this is a great idea. We don't use the tupdesc today
perhaps, but it's plausible that it'd be needed in the future.
Different table AMs might have different sets of system columns.

Thank you for your guidance.I didn't consider that different table AMs
might store system column information in tupdesc before.