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 12:46:52 +0200
Message-ID: <44ACEA1C.9030804@logix-tt.com> (raw)
In-Reply-To: <12b7ac1e0607060316ub7b5e21i5e8e3bef2504e02c@mail.gmail.com>
References: <12b7ac1e0607060316ub7b5e21i5e8e3bef2504e02c@mail.gmail.com>
Hi, David,
David Clarke wrote:
> It occurred to me that if I used a hash function on insert to
> generate another column and used that column as the primary key then I
> have a value that meets a lot of the requirements for a good key,
> including that I can regenerate the exact value from my data,
> something that is impossible with a serial id.
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.
It's some kind of lossy index, pretty the same as the GIST index type
PostGIS uses.
If you've plenty of time to spend, you could also bring the hash index
type back to life, which is currently deprecated according to the
PostgreSQL docs...
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
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: <44ACEA1C.9030804@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