Re: string primary key

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Mark Gibson <mark(at)gibsonsoftware(dot)com>
Cc: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>, pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: string primary key
Date: 2006-05-12 07:05:23
Message-ID: 20060512070523.GC9151@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, May 11, 2006 at 10:43:50 -0600,
Mark Gibson <mark(at)gibsonsoftware(dot)com> wrote:
>
> I've got a followup - The primary key for the table in question consists
> of 2 varchar fields: picture 'state' and 'city' where city is guaranteed
> to be unique within a state, and (state, city) form a unique key. This
> sounds like a good candidate for a sequence key. Is there a difference
> in terms of performance in this case?

That might not be such a good idea. I did a quick check of some GNS data
and found what appear to be 4 different cities in Vermont with the same
name. They are in 4 different counties, so it isn't likely that it is
a single city spanning multiple counties.

VT Mill Village ppl Orange 435738N0721758W Vershire 1014
VT Mill Village ppl Orleans 443958N0722233W Albany 1066
VT Mill Village ppl Essex 442951N0713937W Gilman 1276
VT Mill Village ppl Washington 442029N0724454W Middlesex

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dave Page 2006-05-12 07:11:01 Re: GUI Interface
Previous Message Bruno Wolff III 2006-05-12 06:54:17 Re: string primary key