Re: string primary key - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: string primary key
Date
Msg-id 20060512070523.GC9151@wolff.to
Whole thread Raw
In response to Re: string primary key  (Mark Gibson <mark@gibsonsoftware.com>)
List pgsql-general
On Thu, May 11, 2006 at 10:43:50 -0600,
  Mark Gibson <mark@gibsonsoftware.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

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: string primary key
Next
From: "Dave Page"
Date:
Subject: Re: GUI Interface