Re: check for null value before looking up the hash function

2022-05-21 Thread Tomas Vondra
On 5/21/22 19:24, David G. Johnston wrote: > On Sat, May 21, 2022 at 10:04 AM Ranier Vilela > wrote: > > Em sáb., 21 de mai. de 2022 às 13:13, Tom Lane > escreveu: > > Ranier Vilela mailto:ranier...@gmail.com>> > wri

Re: check for null value before looking up the hash function

2022-05-21 Thread David G. Johnston
On Sat, May 21, 2022 at 10:04 AM Ranier Vilela wrote: > Em sáb., 21 de mai. de 2022 às 13:13, Tom Lane > escreveu: > >> Ranier Vilela writes: >> > Em sáb., 21 de mai. de 2022 às 12:05, Tomas Vondra < >> > tomas.von...@enterprisedb.com> escreveu: >> >> That's a quite bold claim, and yet you have

Re: check for null value before looking up the hash function

2022-05-21 Thread Ranier Vilela
Em sáb., 21 de mai. de 2022 às 13:13, Tom Lane escreveu: > Ranier Vilela writes: > > Em sáb., 21 de mai. de 2022 às 12:05, Tomas Vondra < > > tomas.von...@enterprisedb.com> escreveu: > >> That's a quite bold claim, and yet you haven't supported it by any > >> argument whatsoever. Trade-offs betw

Re: check for null value before looking up the hash function

2022-05-21 Thread Tom Lane
Ranier Vilela writes: > Em sáb., 21 de mai. de 2022 às 12:05, Tomas Vondra < > tomas.von...@enterprisedb.com> escreveu: >> That's a quite bold claim, and yet you haven't supported it by any >> argument whatsoever. Trade-offs between complexity and efficiency are a >> crucial development task, so c

Re: check for null value before looking up the hash function

2022-05-21 Thread David G. Johnston
On Sat, May 21, 2022 at 8:32 AM Ranier Vilela wrote: > Em sáb., 21 de mai. de 2022 às 12:05, Tomas Vondra < > tomas.von...@enterprisedb.com> escreveu: > >> >> >> On 5/21/22 15:06, Ranier Vilela wrote: >> >>Zhihong Yu writes: >> >>> I was looking at the code in hash_record() >> >>> of src/backend

Re: check for null value before looking up the hash function

2022-05-21 Thread Ranier Vilela
Em sáb., 21 de mai. de 2022 às 12:05, Tomas Vondra < tomas.von...@enterprisedb.com> escreveu: > > > On 5/21/22 15:06, Ranier Vilela wrote: > >>Zhihong Yu writes: > >>> I was looking at the code in hash_record() > >>> of src/backend/utils/adt/rowtypes.c > >>> It seems if nulls[i] is true, we don't

Re: check for null value before looking up the hash function

2022-05-21 Thread Tomas Vondra
On 5/21/22 15:06, Ranier Vilela wrote: >>Zhihong Yu writes: >>> I was looking at the code in hash_record() >>> of src/backend/utils/adt/rowtypes.c >>> It seems if nulls[i] is true, we don't need to look up the hash function. > >>I don't think this is worth changing. It complicates the logic, >

Re: check for null value before looking up the hash function

2022-05-21 Thread Ranier Vilela
Em sáb., 21 de mai. de 2022 às 10:06, Ranier Vilela escreveu: > >Zhihong Yu writes: > >> I was looking at the code in hash_record() > >> of src/backend/utils/adt/rowtypes.c > >> It seems if nulls[i] is true, we don't need to look up the hash > function. > > >I don't think this is worth changing.

Re: check for null value before looking up the hash function

2022-05-21 Thread Ranier Vilela
>Zhihong Yu writes: >> I was looking at the code in hash_record() >> of src/backend/utils/adt/rowtypes.c >> It seems if nulls[i] is true, we don't need to look up the hash function. >I don't think this is worth changing. It complicates the logic, >rendering it unlike quite a few other functions w

Re: check for null value before looking up the hash function

2022-05-20 Thread Tom Lane
Zhihong Yu writes: > I was looking at the code in hash_record() > of src/backend/utils/adt/rowtypes.c > It seems if nulls[i] is true, we don't need to look up the hash function. I don't think this is worth changing. It complicates the logic, rendering it unlike quite a few other functions writte

check for null value before looking up the hash function

2022-05-20 Thread Zhihong Yu
Hi, I was looking at the code in hash_record() of src/backend/utils/adt/rowtypes.c It seems if nulls[i] is true, we don't need to look up the hash function. Please take a look at the patch. Thanks hash-record-check-null-first.patch Description: Binary data