pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Markus Schaber <schabi@logix-tt.com>
To: David Clarke <pigwin32@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Alternative to serial primary key
Date: Thu, 06 Jul 2006 13:10:55 +0200
Message-ID: <44ACEFBF.7030903@logix-tt.com> (raw)
In-Reply-To: <12b7ac1e0607060406r16d03f74mfa303eec9ab4821f@mail.gmail.com>
References: <12b7ac1e0607060316ub7b5e21i5e8e3bef2504e02c@mail.gmail.com>
	<44ACEA1C.9030804@logix-tt.com>
	<12b7ac1e0607060406r16d03f74mfa303eec9ab4821f@mail.gmail.com>

Hi, David,

David Clarke wrote:
> On 7/6/06, Markus Schaber <schabi@logix-tt.com> wrote:
>> This is a good idea if you want to have taller indices, but you still
>> need to re-check the "real" key due to hash collisions.
> 
> I am aware there are collisions with md5 but without any actual proof
> I believe the risk to be very low with the data I'm storing which is a
> kind of scrubbed free form residential address.

Then you'll have to use the re-check approach, like:

SELECT * FROM foo WHERE hashed_key = hash(mykey) && plain_key = mykey;

And then have an non-unique index on hashed_key, and probably no index n
my_key (to give the planner a hint which index to use).

HTH,
Markus
-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org



view thread (34+ messages)  latest in thread

Message-ID: <44ACEFBF.7030903@logix-tt.com>
Permalink:  ../44ACEFBF.7030903@logix-tt.com/
Also on:    postgresql.org/message-id/44ACEFBF.7030903@logix-tt.com

 · 

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-sql@postgresql.org
  Cc: schabi@logix-tt.com, pigwin32@gmail.com
  Subject: Re: Alternative to serial primary key
  In-Reply-To: <44ACEFBF.7030903@logix-tt.com>

* 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