Re: Alternative to serial primary key
От | Markus Schaber |
---|---|
Тема | Re: Alternative to serial primary key |
Дата | |
Msg-id | 44ACEA1C.9030804@logix-tt.com обсуждение исходный текст |
Ответ на | Alternative to serial primary key ("David Clarke" <pigwin32@gmail.com>) |
Ответы |
Re: Alternative to serial primary key
|
Список | pgsql-sql |
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
В списке pgsql-sql по дате отправления: