Re: documentation for hashtext?

From: "Massa, Harald Armin" <harald(at)2ndQuadrant(dot)de>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: PGSQL Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: documentation for hashtext?
Date: 2011-08-25 12:05:00
Message-ID: CAMSP2L6WTCqKm9SbEdJCV4xxGjTqB5do=M0O7eTQU+s7gNf46g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> hashtext
>

I believe it's considered an internal function, and not one to rely
> on. If you search the archives, you will find reports around a version
> upgrade when it changed the output for a certain input and thus broke
>

yes. I did find that discussion, and a blog post by Peter E. about this
breakage.

BUT...
http://kaiv.wordpress.com/2007/07/23/decreasing-the-index-size-on-wide-columns/

then there is skytools ... using hashtext for various things, and the
report:

http://postgresql.1045698.n5.nabble.com/Which-is-faster-md5-or-hashtext-td3251399.html

describing it is fact roughly 40% faster then md5 AND is an integer, so

select sum(hastext(t.*::text)) as signature from datable t

as a fast way of comparing 2 replicated tables is really something to
consider....

> 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.

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.

Could I persuade?

Harald

--
Harald Armin Massa www.2ndQuadrant.d <http://www.2ndquadrant.com/>e
PostgreSQL Training, Services and Support

2ndQuadrant Deutschland GmbH
GF: Harald Armin Massa
Amtsgericht Stuttgart, HRB 736399

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Samba 2011-08-25 13:29:14 Re: Streaming Replication: Observations, Questions and Comments
Previous Message Magnus Hagander 2011-08-25 11:56:07 Re: documentation for hashtext?