Re: Reducing relcache memory usage 2: shrink sizeof(RelationData)

From: David Geier <geidav(dot)pg(at)gmail(dot)com>
To: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Cc: Haibo Yan <tristan(dot)yim(at)gmail(dot)com>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, peter(at)eisentraut(dot)org
Subject: Re: Reducing relcache memory usage 2: shrink sizeof(RelationData)
Date: 2026-10-18 11:42:44
Message-ID: e3429e24-2e7f-4322-8d16-e0e308d168e0@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>> Move the definition of RelationData into utils/rel_internal.h. Otherwise,
>> gen_node_support.pl cannot process rel.h after the anonymous unions are
>> introduced by the following commit, because the script does not support
>> parsing anonymous unions.
>
> I really dislike this. Why not do it the other way around, and put the
> one struct that gen_node_support.pl wants in a separate file instead?
> As in the attached WIP. New file name TBD, of course.
That's indeed nicer.

I had moved struct RelationData to rel_internal.h as a quick workaround
when I started to be able to make progress without bothering. Now it's
time to fix this properly.

We can do what you suggest, or alternatively, teach gen_node_support.pl
to skip anonymous structs/unions in non-node structs. Then we can keep
all code as before in rel.h. See attached patch.

Once we settle on how to go forward, I'll update the main patch set.

--
David Geier

Attachment Content-Type Size
v1-0001-gen_node_support.pl-skips-anonymous-structs-union.patch text/plain 2.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2026-10-18 12:51:59 Re: index prefetching
Previous Message Greg Burd 2026-10-18 10:59:09 Re: Expanding HOT updates for expression and partial indexes