Re: General purpose hashing func in pgbench

Fabien COELHO <coelho@cri.ensmp.fr>

From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Ildar Musin <i.musin@postgrespro.ru>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2017-12-21T15:26:04Z
Lists: pgsql-hackers
> I think it is not commitfest ready yet -- I need to add some
> documentation and tests first.

Yes, doc & test are missing.

From your figures, the murmur2 algorithm output looks way better. I'm 
wondering whether it makes sense to provide a bad hash function if a 
good/better one is available, unless the bad one actually appears in some 
benchmark... So I would suggest to remove fnv1a.

One implementation put constants in defines, the other one uses "const 
int". The practice in pgbench seems to use defines (eg 
MIN_GAUSSIAN_PARAM...), so I would suggest to stick to this style.

I'm wondering whether "hash" should be a shorthand for one hash functions, 
as a provided default chosen for its quality and efficiency.

-- 
Fabien.


Commits

  1. Add general purpose hasing functions to pgbench.