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

Re: Do non-sequential primary keys slow performance significantly??

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Damian C <jamianb(at)gmail(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Do non-sequential primary keys slow performance significantly??
Date: 2006-09-29 15:10:23
Message-ID: 20060929151023.78307.qmail@web31802.mail.mud.yahoo.com (view raw or flat)
Thread:
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.

One problem with using random generated primary keys that I've
recently read about deal with insert failing do to primary key
duplication.

If the size of your dataset grows to become a significant percentage
of the size of the integer type used for your random primary key,
the probability of inserting a duplicated number dramatically
increases.  I imagine that this problem could contribute to poor
preformance for large bulk inserts that have to add logic for 
dealing with re-trying a insert if a duplicate number is created.

Regards,

Richard Broersma Jr.

In response to

Responses

pgsql-novice by date

Next:From: Brandon AikenDate: 2006-09-29 18:44:59
Subject: Re: [NOVICE] Do non-sequential primary keys slow performance significantly??
Previous:From: Shane AmblerDate: 2006-09-29 13:36:57
Subject: Re: Do non-sequential primary keys slow performance

pgsql-general by date

Next:From: Paul B. AndersonDate: 2006-09-29 15:12:08
Subject: Re: Stored procedure array limits
Previous:From: Paul B. AndersonDate: 2006-09-29 15:00:13
Subject: Re: Stored procedure array limits

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