Re: documentation for hashtext?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: "Massa, Harald Armin" <harald(at)2ndQuadrant(dot)de>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, PGSQL Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: documentation for hashtext?
Date: 2011-08-27 11:29:56
Message-ID: 1314444596.2349.7.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On tor, 2011-08-25 at 14:05 +0200, Massa, Harald Armin wrote:
> > conclusion was that it's not documented because it's internal and
> > you're not supposed to use/rely on it.
> >
> > My impression is that people are allready using it, relying their sharding
> on it, even building indexes on it.

I think a better solution is either to implement lookup3 in PostgreSQL,
which is what hashtext was originally based on, so you have a hash
function that won't change and is comparable to the current one in
behavior. Or you use a standard cryptographic hash function such as md5
or sha1 and shard by that. They are slower than the lookup3-type hash
functions, but for multiple-node applications, it's probably OK.

> So... I suggest we start documenting it. Even if there was a
> recommendation not to use it, people will get hurt anyway if their
> application rely on it and it breaks.

Well, it's already broken for what people are using it or are thinking
about using it, and documenting it won't help that. Better come up with
a purpose-built solution, as per above.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Maton, Brett 2011-08-27 12:56:37 Re: Performing upgrade to latest minor release using PGDG RPMs
Previous Message Amitabh Kant 2011-08-27 10:28:11 Re: Selecting all records which are in upper case