On Mon, Apr 22, 2019 at 9:35 AM Andres Freund <and...@anarazel.de> wrote: > I, more generally, wonder if there's not a case to squeeze out more > padding than "just" what you describe (since we IIRC don't frequently > keep pointers into such tuples anyway, and definitely don't for byval > attrs). But that's very likely better done separately.
There is one way that that is kind of relevant here. The current requirement seems to be that *any* sort of tuple header be MAXALIGN()'d, because in the worst case the first attribute needs to be accessed at a MAXALIGN()'d boundary on an alignment-picky platform. That isn't so bad today, since we usually find a reasonably good way to put those 8 bytes (or 23/24 bytes in the case of heap tuples) to use. However, with varwidth table identifiers, the only use of those 8 bytes that I can think of is the offset to the identifier (or perhaps its length), plus the usual t_info stuff. We'd almost invariably waste 4 or 5 bytes, which seems like a problem to me. -- Peter Geoghegan