Re: pgsql: Use CompactAttribute more often, when possible

2025-10-23 Thread David Rowley
On Fri, 24 Oct 2025 at 01:21, Robert Haas wrote: > David, I've noticed several times lately you've documented in commit > messages why you thought going further with some change would be > risky, and I really like that. I think sometimes we (as committers) > are sometimes reluctant to document cas

Re: pgsql: Use CompactAttribute more often, when possible

2025-10-23 Thread Robert Haas
On Tue, Oct 21, 2025 at 6:36 PM David Rowley wrote: > There are some locations where I've left the code using > FormData_pg_attribute. These are mostly in the ALTER TABLE code. Using > CompactAttribute here seems more risky as often the TupleDesc is being > changed and those changes may not have

Re: Use CompactAttribute more often, when possible

2025-10-21 Thread David Rowley
On Mon, 20 Oct 2025 at 21:43, David Rowley wrote: > > On Mon, 20 Oct 2025 at 21:15, Michael Paquier wrote: > > > > On Mon, Oct 20, 2025 at 05:46:33PM +1300, David Rowley wrote: > > @@ -5146,10 +5146,6 @@ ReorderBufferToastReplace(ReorderBuffer *rb, > > ReorderBufferTXN *txn, > > dlist_i

Re: Use CompactAttribute more often, when possible

2025-10-20 Thread David Rowley
On Mon, 20 Oct 2025 at 22:33, Chao Li 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 pat

Re: Use CompactAttribute more often, when possible

2025-10-20 Thread Chao Li
> On Oct 20, 2025, at 16:49, David Rowley wrote: > > On Mon, 20 Oct 2025 at 21:34, Chao Li wrote: >> I search for “TupleDescAttr”, and found more occurrences to replace. See the >> attached diff file. > > Thanks for looking. There was a bunch that I didn't do and tried to > convey that in t

Re: Use CompactAttribute more often, when possible

2025-10-20 Thread Álvaro Herrera
On 2025-Oct-20, David Rowley wrote: > There's also some more > complexity around CompactAttribute.attnotnull that's crept in. I think > I roughly understand the need for that, but the intent of > CompactAttribute mirroring commonly used pg_attribute fields is made > no longer true by those changes

Re: Use CompactAttribute more often, when possible

2025-10-20 Thread David Rowley
On Mon, 20 Oct 2025 at 21:34, Chao Li wrote: > I search for “TupleDescAttr”, and found more occurrences to replace. See the > attached diff file. Thanks for looking. There was a bunch that I didn't do and tried to convey that in the commit message. The diff you sent seems to contain a mix of m

Re: Use CompactAttribute more often, when possible

2025-10-20 Thread David Rowley
On Mon, 20 Oct 2025 at 21:15, Michael Paquier wrote: > > On Mon, Oct 20, 2025 at 05:46:33PM +1300, David Rowley wrote: > > I don't think the attached is very interesting to look at, but l'll > > leave it here for a bit just in case anyone wants to look. Otherwise, > > I plan to just treat it as a

Re: Use CompactAttribute more often, when possible

2025-10-20 Thread Chao Li
> On Oct 20, 2025, at 12:46, David Rowley wrote: > > 5983a4cff added CompactAttribute to TupleDesc to allow commonly > accessed fields from the FormData_pg_attribute array to be accessed > more quickly by having to load fewer cachelines from memory. That > commit also went around and changed ma

Re: Use CompactAttribute more often, when possible

2025-10-20 Thread Michael Paquier
On Mon, Oct 20, 2025 at 05:46:33PM +1300, David Rowley wrote: > I don't think the attached is very interesting to look at, but l'll > leave it here for a bit just in case anyone wants to look. Otherwise, > I plan to just treat it as a follow-up of 5983a4cff. Still I've looked at it. I like readin

Use CompactAttribute more often, when possible

2025-10-19 Thread David Rowley
5983a4cff added CompactAttribute to TupleDesc to allow commonly accessed fields from the FormData_pg_attribute array to be accessed more quickly by having to load fewer cachelines from memory. That commit also went around and changed many locations to use CompactAttribute, but not all locations. T