Re: indexes - Mailing list pgsql-general

From Harald Armin Massa
Subject Re: indexes
Date
Msg-id 7be3f35d0611250933s6abf040axe90a321a3b928aa7@mail.gmail.com
Whole thread Raw
In response to Re: indexes  (Tom Allison <tom@tacocat.net>)
List 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.

pgsql-general by date:

Previous
From: Tom Allison
Date:
Subject: Re: indexes
Next
From: Richard Troy
Date:
Subject: Re: Development of cross-platform GUI for Open Source DBs