Re: Primary Key

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: Primary Key
Дата
Msg-id 87lk8xvf8q.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: Primary Key  (Ron Johnson <ron.l.johnson@cox.net>)
Ответы Re: Primary Key
Список pgsql-general
"Ron Johnson" <ron.l.johnson@cox.net> writes:

> On 11/16/07 12:50, João Paulo Zavanela wrote:
>> Hello,
>>
>> How many fields is recomended to create a primary key?
>> I'm thinking to create one with 6 fields, is much?
>
> The number of recommended fields is the *minimum* number required
> for uniqueness.  1 or 6 or 24.  Doesn't matter.

Unless of course you care about every other table being 24x larger and slower
due to having all these copies of the 24 fields. And of course unless you care
about being able to handle the inevitable day when it turns out the 24 fields
aren't unique and you need to consider adding a 25th column to the table *and
every table referencing it* as well as changing every line of application code
to use the new column.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Get trained by Bruce Momjian - ask me about EnterpriseDB's PostgreSQL training!

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

Предыдущее
От: "Trevor Talbot"
Дата:
Сообщение: Re: how should I do to disable the foreign key in postgres?
Следующее
От: Gregory Stark
Дата:
Сообщение: Re: Variable LIMIT and OFFSET in SELECTs