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

Re: numerical primary key vs alphanumerical primary key

From: Grant Johnson <grant(at)amadensor(dot)com>
To: Julien Cigar <jcigar(at)ulb(dot)ac(dot)be>,pgsql-performance(at)postgresql(dot)org
Subject: Re: numerical primary key vs alphanumerical primary key
Date: 2013-02-12 15:05:29
Message-ID: d89c7bde-2314-4f00-8dd3-c4d2c13bff44@email.android.com (view raw or flat)
Thread:
Lists: pgsql-performance
My experience has been that the performance advantage for numeric keys is primarily an Oracle thing.  However, Oracle is popular enough for people to assume that it applies to databases in general.

Julien Cigar <jcigar(at)ulb(dot)ac(dot)be> wrote:

>The biggest difference in performance between text and integer keys is 
>usually down to whether you're inserting in order or not. Inserting in 
>order is tons faster regardless of the type, since it keeps the index 
>unfragmented and doesn't cause page splits.
>
>On 02/04/2013 22:52, Anne Rosset wrote:
>>
>> Hi,
>>
>> I have read a lot of different information about the benefits of
>using 
>> numerical primary key vs alphanumerical primary key(small size). And 
>> what I am gathering is that for performance there is no more great 
>> advantage.
>>
>> It seems like now RDBMS in general, postgres in particular handles 
>> pretty well joins on text indexes.
>>
>> Did I understand correctly?
>>
>> Thanks,
>>
>> Anne
>>

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

In response to

Responses

pgsql-performance by date

Next:From: Florent GuillaumeDate: 2013-02-12 15:14:15
Subject: Re: numerical primary key vs alphanumerical primary key
Previous:From: Julien CigarDate: 2013-02-12 13:06:57
Subject: Re: numerical primary key vs alphanumerical primary key

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