Skip site navigation (1) Skip section navigation (2)

Do non-sequential primary keys slow performance significantly??

From: "Damian C" <jamianb(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Do non-sequential primary keys slow performance significantly??
Date: 2006-09-29 05:29:18
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-generalpgsql-novice
The most difficult part of this question is justifying WHY we would
want to use random primary keys!  There is a very strong reason for
doing so, although not quite compelling.

We are Java developers developing desktop applications that persist
data in postgres. This is a pretty "low spec" database as it will only
servicing a few PCs.  We do this via Hibernate so our SQL & Postrges
skills and insights are relatively lacking.  I certainly don't really
understand the gory internal details of postgres.

We have an internal proposal to use what are virtually random 128 bit
numbers for our primary keys.  These are not truley random in any
mathematical sense, and they will be unique, but they are certainly
NOT sequential.

In my ignorant bliss I would suspect that postgres will run more
slowly using random primary keys. Can anyone provide any "rules of
thumb" for how this may effect performance??  Is it a plain dumb
idea?? Or maybe it would have only modest impact??

Any comments, insights, pointers are very much appreciated,



pgsql-novice by date

Next:From: Tom LaneDate: 2006-09-29 05:49:05
Subject: Re: Do non-sequential primary keys slow performance significantly??
Previous:From: John KollerDate: 2006-09-29 03:55:19
Subject: Re: tablespace?

pgsql-general by date

Next:From: Bo LorentsenDate: 2006-09-29 05:37:10
Subject: Re: Replication and PITR
Previous:From: Tom LaneDate: 2006-09-29 03:57:12
Subject: Re: Stored procedure array limits

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group