Re: Use CompactAttribute more often, when possible
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Chao Li <li.evan.chao@gmail.com>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2025-10-20T10:03:08Z
Lists: pgsql-hackers
On Mon, 20 Oct 2025 at 22:33, Chao Li <li.evan.chao@gmail.com> wrote: > I have removed those ones that you don’t want in v2 diff. Looks like it's just the rowtypes.c ones that you have that I didn't list. get_sql_insert() and FreeTupleDesc() were in my reject list. The extra ones you've found seem to match a similar pattern to other ones I did reject. The reason I left out the ones that could access the CompactAttribute in one part of the function, but also *need* to access the Form_pg_attribute in another part, was that I wasn't certain it was going to be a win. One way it could be a net loss is that now you need to load cachelines for both structs. It looks like your changes to record_cmp(), record_eq() and record_image_eq() might be more optimal in cases where the record has many dropped columns, as that would allow us to skip fetching the Form_pg_attribute memory for dropped columns. IMO, it doesn't seem like a good thing to optimise for in exchange for additional overhead when there are no or few dropped columns. David
Commits
-
Use CompactAttribute more often, when possible
- 2470ca435c45 19 (unreleased) landed