Re: indexes

Поиск
Список
Период
Сортировка
От Harald Armin Massa
Тема Re: indexes
Дата
Msg-id 7be3f35d0611250933s6abf040axe90a321a3b928aa7@mail.gmail.com
обсуждение исходный текст
Ответ на Re: indexes  (Tom Allison <tom@tacocat.net>)
Список 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 по дате отправления:

Предыдущее
От: Tom Allison
Дата:
Сообщение: Re: indexes
Следующее
От: Richard Troy
Дата:
Сообщение: Re: Development of cross-platform GUI for Open Source DBs