Re: indexes

From: "Harald Armin Massa" <haraldarminmassa(at)gmail(dot)com>
To: "Tom Allison" <tom(at)tacocat(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: indexes
Date: 2006-11-25 17:33:35
Message-ID: 7be3f35d0611250933s6abf040axe90a321a3b928aa7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom,

If the real-world primary key is large (say up to 100 characters in length)
> then
> the disadvantage is that you are duplicating this referenced key in
> several
> other tables, each element taking up 100 characters. Space is wasted when
> compared to int4 ID's. But not really sure if this is a performance
> problem for
> SELECT except for the space required (varchar(128) vs. int4).
>

What is worth a try is to check an md5 or sha hash of those 100chars and use
that as a key.

with a proper hashing algorythm (proper= fitting to your data) collisions
should not happen; and you have a shorter key to connect the tables.

best wishes

harald

--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
0173/9409607
-
Python: the only language with more web frameworks than keywords.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Troy 2006-11-25 19:12:00 Re: Development of cross-platform GUI for Open Source DBs
Previous Message Tom Allison 2006-11-25 17:14:11 Re: indexes