Re: Integer keys vs. Varchar keys

From: David Link <dlink(at)soundscan(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Integer keys vs. Varchar keys
Date: 2001-11-30 23:16:08
Message-ID: 3C081338.AC471B69@soundscan.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
>
> David Link <dlink(at)soundscan(dot)com> writes:
> > What performance gains would an integer primary key have over a varchar
> > primary key, for table joins?
>
> The comparison operation itself would surely be faster for integers, but
> that would probably be swamped out by disk access and other overhead.
> What I'd expect is that any measurable difference would come from more
> I/O required due to physical increase in the table and index sizes,
> because of larger field sizes in the varchar case. Since you didn't say
> how long your varchar keys might be, it's anyone's guess what the
> differential will be.

varchar(12). An alpha numeric UPC code.

Thanks for the information,
David

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Samik Raychaudhuri 2001-11-30 23:36:02 Installing DBD::Pg module without Pg Database server
Previous Message Tom Lane 2001-11-30 23:13:00 Re: Timing a query