Re: string primary key

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: string primary key
Дата
Msg-id 20060512070523.GC9151@wolff.to
обсуждение исходный текст
Ответ на Re: string primary key  (Mark Gibson <mark@gibsonsoftware.com>)
Список 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 по дате отправления:

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: string primary key
Следующее
От: "Dave Page"
Дата:
Сообщение: Re: GUI Interface