Re: Advice on index and constraint definition

Поиск
Список
Период
Сортировка
От David G Johnston
Тема Re: Advice on index and constraint definition
Дата
Msg-id 1411264502294-5819815.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: Advice on index and constraint definition  (JORGE MALDONADO <jorgemal1960@gmail.com>)
Список pgsql-novice
JORGE MALDONADO wrote
> Thanks for your answer. I am a DB novice and I still have questions, I
> would like you to explain a bit more about the following:
>
> " I'd generally question a design that uses 5 foreign keys on a matching
> table"
>
> Does this mean that my table with 5 foreign keys should have fewer foreign
> keys? How could I achieve this goal if such a table depends on 5 other
> tables? Maybe a must take into account a redesign of this precise table.

My point is a single table relating five other individual tables is quite
probably not properly normalized.  If you are using multi-column primary
keys then the presence of 5 columns might only represent 2 source tables
which would be more 'normal'.

This kind of table typically is used for a direct many-to-many relationship
so having 5 foreign keys would definitely complicate the logic.

David J.





--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Advice-on-index-and-constraint-definition-tp5819799p5819815.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.


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

Предыдущее
От: JORGE MALDONADO
Дата:
Сообщение: Re: Advice on index and constraint definition
Следующее
От: Kevin Struckhoff
Дата:
Сообщение: Unable to connect remotely to postgres server