Search Postgresql Archives

Re: string primary key

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Using interger as opposed to a character as a primary key has an advantage when it comes to querying data in the table, it is faster searching with an interger as compared to characters date types

+-----------------------------------------------------+
| Martin W. Kuria (Mr.) martin.kuria@xxxxxxxx
+----------------------------------------------------+




From: Bruno Wolff III <bruno@xxxxxxxx>
To: Mark Gibson <mark@xxxxxxxxxxxxxxxxxx>
CC: pgsql-general@xxxxxxxxxxxxxx
Subject: Re: [GENERAL] string primary key
Date: Fri, 12 May 2006 01:54:17 -0500

On Thu, May 11, 2006 at 09:52:41 -0600,
  Mark Gibson <mark@xxxxxxxxxxxxxxxxxx> wrote:
> Is there a disadvantage to having the primary key for a table be a text
> type vs. an integer type?  Performance?  Any difference between having a
> varchar or char as a primary key?

You probably want to use 'text' unless there is a busniess rule limiting
the size of the field.

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux