Should get_rel_data_width take alignment into account? - Mailing list pgsql-hackers

From Andres Freund
Subject Should get_rel_data_width take alignment into account?
Date
Msg-id 20181211070828.mwzrswj5nepikuhk@alap3.anarazel.de
Whole thread Raw
List pgsql-hackers
Hi,

I'm working on the pluggable storage patch and zheap at the moment. The
latter the latter has no alignment padding for byval attributes - since
we copy them anyway - and I was looking which places need to be adjusted
for that.  That lead me to notice that get_rel_data_width() currently
doesn't take alignment padding into account, even for byval or
fixed-width datatypes.  In a lot of cases that's probably a wash, but
it's easy enough to come up with cases where a substantial portion of
a row is padding,

It's probably not trivial to do better for all cases, but it woudln't be
too hard to estimate padding between some types of columns (say fixed
width and byval columns).

I'm not planning to work on this anytime soon, but it seems like this is
worth fixing at some point.

Greetings,

Andres Freund


pgsql-hackers by date:

Previous
From: Ibrar Ahmed
Date:
Subject: Re: Interesting paper: Contention-Aware Lock Scheduling
Next
From: Andrey Borodin
Date:
Subject: Re: Connections hang indefinitely while taking a gin index's LWLockbuffer_content lock