Which is faster: md5() or hashtext()?

From: "Henry C(dot)" <henka(at)cityweb(dot)co(dot)za>
To: pgsql-general(at)postgresql(dot)org
Subject: Which is faster: md5() or hashtext()?
Date: 2010-11-05 07:19:20
Message-ID: 59df37f0b52657a0f5114684fe96a9cb.squirrel@zenmail.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

G'day,

I need to do a mass update on about 550 million rows (I will be breaking it up
into chunks based on id value so I can monitor progress).

Hashing one of the columns is part of the process and I was wondering which is
more efficient/faster: md5() or hashtext()?

hashtext() produces a nice tight integer value, whereas md5() produces a fixed
string. My instinct says hashtext(), but there may be a lot more to hashext()
than meets the eye.

Any ideas?

Thanks
Henry

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Grzegorz Jaśkiewicz 2010-11-05 07:52:49 Re: Which is faster: md5() or hashtext()?
Previous Message hubert depesz lubaczewski 2010-11-05 05:58:52 Re: How do you control IMMUTABLE PG PROC results?