atom feed3 messages in org.postgresql.pgsql-generalRe: Primary Key Performance with INTE...
FromSent OnAttachments
SiahJul 21, 2007 5:48 am 
Jim NasbyJul 24, 2007 11:47 am 
Merlin MoncureJul 24, 2007 6:35 pm 
Subject:Re: Primary Key Performance with INTEGER vs. VARCHAR
From:Jim Nasby (deci@decibel.org)
Date:Jul 24, 2007 11:47:05 am
List:org.postgresql.pgsql-general

On Jul 21, 2007, at 5:49 AM, Siah wrote:

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.

Generally, anything dealing with a text/varchar field is going to be slower than on, say, an integer. But remember the first rule of performance tuning: don't. Do you *really* need to worry about the extra overhead of varchar vs int? Probably not.