Should get_rel_data_width take alignment into account?

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Should get_rel_data_width take alignment into account?
Date: 2018-12-11 07:08:28
Message-ID: 20181211070828.mwzrswj5nepikuhk@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Borodin 2018-12-11 07:14:50 Re: Connections hang indefinitely while taking a gin index's LWLock buffer_content lock
Previous Message Ibrar Ahmed 2018-12-11 06:24:33 Re: Interesting paper: Contention-Aware Lock Scheduling