Search Postgresql Archives

Re: Primary Key Performance with INTEGER vs. VARCHAR

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

 



On 7/21/07, Siah <siasookhteh@xxxxxxxxx> wrote:
Hi,

Designing my application, I was wondering if having my primary keys
(to be indexed) with VARCHAR brings performance down significantly? My
own test didn't show much difference. Thinking about it though, I'd
guess Integer Indexing should be much quicker and efficient.

Integer indexes are usually quicker to build and smaller which
translates to speed (better utilization of o/s cache).  The difference
between a index lookup in cache/not in cache is much bigger than index
lookup integer/text.  OTOH, text natural keys save you an index you
often have to make anyways and can optimize out joins in some cases.
so the answer is, 'it depends' :-)

merlin


[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