pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Ildar Musin <i.musin@postgrespro.ru>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: General purpose hashing func in pgbench
Date: Tue, 9 Jan 2018 21:11:26 +0100 (CET)
Message-ID: <alpine.DEB.2.20.1801092000230.2326@hendaye> (raw )
In-Reply-To: <9603bac9-ae5d-36c5-5978-a88bdb700e37@postgrespro.ru >
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 >
<80e9c570-5c49-1a01-f309-3d8d0cbbae42@postgrespro.ru >
<alpine.DEB.2.20.1712240846440.22976@lancre >
<38f1503e-7b63-4612-24a9-041af25bb022@postgrespro.ru >
<alpine.DEB.2.20.1712251506160.22976@lancre >
<af1ccd41-dcd0-f56b-0a05-a558da54762b@postgrespro.ru >
<alpine.DEB.2.20.1712251702170.22976@lancre >
<9603bac9-ae5d-36c5-5978-a88bdb700e37@postgrespro.ru >
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.
view thread (44+ messages) latest in thread
Message-ID: <alpine.DEB.2.20.1801092000230.2326@hendaye>
Permalink: ../alpine.DEB.2.20.1801092000230.2326@hendaye/
Also on: postgresql.org/message-id/alpine.DEB.2.20.1801092000230.2326@hendaye
copy link · copy postgr.es
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: coelho@cri.ensmp.fr, i.musin@postgrespro.ru
Subject: Re: General purpose hashing func in pgbench
In-Reply-To: <alpine.DEB.2.20.1801092000230.2326@hendaye>
* 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