pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ildar Musin <i.musin@postgrespro.ru>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: General purpose hashing func in pgbench
Date: Fri, 22 Dec 2017 13:54:57 +0300
Message-ID: <80e9c570-5c49-1a01-f309-3d8d0cbbae42@postgrespro.ru> (raw)
In-Reply-To: <alpine.DEB.2.20.1712211620040.32625@lancre>
References: <0e8bd39e-dfcd-2879-f88f-272799ad7ef2@postgrespro.ru>
	<alpine.DEB.2.20.1712200807550.5165@lancre>
	<699225ee-c30c-b22e-4028-415e9eab26b2@postgrespro.ru>
	<alpine.DEB.2.20.1712211620040.32625@lancre>


21/12/2017 18:26, Fabien COELHO пишет:
>
>> 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.
Actually the "bad" one appears in YCSB. But if we should choose the only
one I would stick to murmur too given it provides better results while
having similar computational complexity.
>
> 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.
That had been my intention from the start until I coded it that way and
it looked ugly and hard to read (IMHO), like:

    k *= MURMUR2_M;
    k ^= k >> MURMUR2_R;
    k *= MURMUR2_M;
    result ^= k;
    result *= MURMUR2_M;

...etc. And besides it is not a parameter to be tuned and not something
someone would ever want to change; it appears in just a single function.
So I'd better leave it the way it is. Actually I was thinking to do the
same to fnv1a too : )

-- 
Ildar Musin
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company 





view thread (44+ messages)  latest in thread

Message-ID: <80e9c570-5c49-1a01-f309-3d8d0cbbae42@postgrespro.ru>
Permalink:  ../80e9c570-5c49-1a01-f309-3d8d0cbbae42@postgrespro.ru/
Also on:    postgresql.org/message-id/80e9c570-5c49-1a01-f309-3d8d0cbbae42@postgrespro.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: i.musin@postgrespro.ru, coelho@cri.ensmp.fr
  Subject: Re: General purpose hashing func in pgbench
  In-Reply-To: <80e9c570-5c49-1a01-f309-3d8d0cbbae42@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox