[PATCH] The heap_getsysattr function deletes unused parameters

Started by lei yangabout 18 hours ago3 messageshackers
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:

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