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

Поиск
Список
Период
Сортировка
От Ranier Vilela
Тема Re: check for null value before looking up the hash function
Дата
Msg-id CAEudQApKr6XEeK1O7RAO3=si7Y3a0kdhyRinKZUpNEV+w9aYrA@mail.gmail.com
обсуждение исходный текст
Ответ на check for null value before looking up the hash function  (Zhihong Yu <zyu@yugabyte.com>)
Ответы Re: check for null value before looking up the hash function  (Ranier Vilela <ranier.vf@gmail.com>)
Re: check for null value before looking up the hash function  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Список pgsql-hackers
>Zhihong Yu <zyu(at)yugabyte(dot)com> 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 written in the same
>style. In cases where the performance actually matters, the hash
>function is cached across multiple calls anyway. You might save
>something if you have many calls in a query and not one of them
>receives a non-null input, but how likely is that?

I disagree.
I think that is worth changing. The fact of complicating the logic
is irrelevant.
But maybe the v2 attached would be a little better.
My doubt is the result calc when nulls are true.

regards,
Ranier Vilela
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bharath Rupireddy
Дата:
Сообщение: Re: definition of CalculateMaxmumSafeLSN
Следующее
От: Justin Pryzby
Дата:
Сообщение: doc: CREATE FOREIGN TABLE .. PARTITION OF .. DEFAULT