Re: Matching unique primary keys

Поиск
Список
Период
Сортировка
От Shridhar Daithankar
Тема Re: Matching unique primary keys
Дата
Msg-id 3DB8686C.14874.2711EA3@localhost
обсуждение исходный текст
Ответ на Re: Matching unique primary keys  (Kevin Old <kold@carolina.rr.com>)
Список pgsql-general
On 23 Oct 2002 at 12:39, Kevin Old wrote:

> 1) Copy the 3 "unique fields" into every table (as you mention above).
> My only question with this is how am I to do a join on a multicolumn
> primary key?  The only thing I can think of would be something like:
>
> SELECT *
> FROM data_index, data_tbl
> WHERE data_index.id1 = data_tbl.id1
> AND data_index.id2 = data_tbl.id2
> AND data_index.id3 = data_tbl.id3

Well you can store the 3 fields in a table, declare the combination of them as
primary key and add a fourth field that is sequence generated and use this
sequence number as primary key in rest of them tables. Will reuce the IO
requirement by oodles..

HTH

Bye
 Shridhar

--
ASCII:    The control code for all beginning programmers and those who would
become computer literate.  Etymologically, the term has come down as    a
contraction of the often-repeated phrase "ascii and you shall    receive."        --
Robb Russon


В списке pgsql-general по дате отправления:

Предыдущее
От: Brian Hirt
Дата:
Сообщение: Re: 7.3b2 strangeness
Следующее
От: "Johnson, Shaunn"
Дата:
Сообщение: primary key