Re: clarify equalTupleDescs()

2024-03-17 Thread Peter Eisentraut
On 13.03.24 19:43, Tomas Vondra wrote: I looked at this patch today. I went through all the calls switched to equalRowTypes, and AFAIK all of them are correct - all the places switched to equalRowTypes() only need the weaker checks. There's only two places still calling equalTupleDescs() -

Re: clarify equalTupleDescs()

2024-03-13 Thread Tomas Vondra
On 2/27/24 12:13, jian he wrote: > On Mon, Feb 12, 2024 at 7:47 PM Peter Eisentraut wrote: >> >> >> In principle, hashRowType() could process all the fields that >> equalRowTypes() does. But since it's only a hash function, it doesn't >> have to be perfect. (This is also the case for the

Re: clarify equalTupleDescs()

2024-03-13 Thread Tomas Vondra
Hi, I looked at this patch today. I went through all the calls switched to equalRowTypes, and AFAIK all of them are correct - all the places switched to equalRowTypes() only need the weaker checks. There's only two places still calling equalTupleDescs() - relcache certainly needs that, and so

Re: clarify equalTupleDescs()

2024-02-27 Thread jian he
On Mon, Feb 12, 2024 at 7:47 PM Peter Eisentraut wrote: > > > In principle, hashRowType() could process all the fields that > equalRowTypes() does. But since it's only a hash function, it doesn't > have to be perfect. (This is also the case for the current > hashTupleDesc().) I'm not sure

Re: clarify equalTupleDescs()

2024-02-12 Thread Tom Lane
Peter Eisentraut writes: > On 06.02.24 16:14, Tom Lane wrote: >> +1 for the general idea, but it seems like "row type equality" >> might still be a slightly fuzzy concept. > I did another pass across the callers to check what pg_attribute fields > might be relevant. > Collation definitely

Re: clarify equalTupleDescs()

2024-02-12 Thread Peter Eisentraut
On 06.02.24 16:14, Tom Lane wrote: Peter Eisentraut writes: The first want to compare what I call row-type equality, which means they want to check specifically for equal number of attributes, and the same attribute names, types, and typmods for each attribute. Most callers actually want that

Re: clarify equalTupleDescs()

2024-02-12 Thread Peter Eisentraut
On 07.02.24 04:06, jian he wrote: /* * hashRowType * * If two tuple descriptors would be considered equal by equalRowTypes() * then their hash value will be equal according to this function. */ uint32 hashRowType(TupleDesc desc) { uint32 s; int i; s = hash_combine(0,

Re: clarify equalTupleDescs()

2024-02-06 Thread jian he
On Tue, Feb 6, 2024 at 8:59 PM Peter Eisentraut wrote: > > In a recent patch thread it was discussed[0] which fields should be > compared by equalTupleDescs() and whether it is ok to remove a field > from tuple descriptors and how that should affect their equality > (attstattarget in that case).

Re: clarify equalTupleDescs()

2024-02-06 Thread Tom Lane
Peter Eisentraut writes: > The first want to compare what I call row-type equality, which means > they want to check specifically for equal number of attributes, and the > same attribute names, types, and typmods for each attribute. Most > callers actually want that behavior. Should compare

clarify equalTupleDescs()

2024-02-06 Thread Peter Eisentraut
In a recent patch thread it was discussed[0] which fields should be compared by equalTupleDescs() and whether it is ok to remove a field from tuple descriptors and how that should affect their equality (attstattarget in that case). After analyzing all the callers, I have noticed that there