Re: Optimizing query: select ... where id = 4 and md5(...)

From: Alban Hertroys <alban(at)magproductions(dot)nl>
To: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Optimizing query: select ... where id = 4 and md5(...)
Date: 2006-07-03 15:52:46
Message-ID: 44A93D4E.5020808@magproductions.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alexander Farber wrote:
> I wonder, what is faster: fetching 2 columns - the
> username and the md5-result and then comparing the
> md5 string against the argument in my app, like here:
>
> punbb=> select username, md5('deadbeef' || password) from users where id
> = 4;
> username | md5
> ----------+----------------------------------
> Vasja | dcde745cc304742e26d62e683a9ecb0a
> (1 row)

Why don't you store the hashed value instead?

--
Alban Hertroys
alban(at)magproductions(dot)nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
7500 AK Enschede

// Integrate Your World //

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vivek Khera 2006-07-03 16:06:26 Re: pgsql user change to postgres
Previous Message Jacob Coby 2006-07-03 15:52:17 Re: autovacuum template0