Re: General purpose hashing func in pgbench

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: General purpose hashing func in pgbench
Дата
Msg-id alpine.DEB.2.20.1801092000230.2326@hendaye
обсуждение исходный текст
Ответ на Re: General purpose hashing func in pgbench  (Ildar Musin <i.musin@postgrespro.ru>)
Ответы Re: General purpose hashing func in pgbench
Список pgsql-hackers
Hello Ildar,

> Sorry for a long delay. I've added hash() function which is just an
> alias for murmur2. I've also utilized variable arguments feature from
> least()/greates() functions to make optional seed parameter, but I
> consider this as a hack.

Patch needs a rebase after Teodor push for a set of pgbench functions.

> Should we probably add some infrastructure for optional arguments?

You can look at the handling of "CASE" which may or may not have an "ELSE" 
clause.

I'd suggest you use a new negative argument with the special meaning for 
hash, and create the seed value when missing when building the function, 
so as to simplify the executor code.

Instead of 0, I'd consider providing a random default so that the hashing 
behavior is not the same from one run to the next. What do you think?

Like the previous version, murmur2 with seed looks much more random than 
fnv with seed...

-- 
Fabien.


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

Предыдущее
От: Alexander Korotkov
Дата:
Сообщение: Re: Challenges preventing us moving to 64 bit transaction id (XID)?
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [HACKERS] [PATCH] Assert that the correct locks are held whencalling PageGetLSN()