Re: Avoiding surrogate keys

Поиск
Список
Период
Сортировка
От Grzegorz Jaśkiewicz
Тема Re: Avoiding surrogate keys
Дата
Msg-id y2m2f4958ff1005040744o4a9b0deu58c0e23380a467fe@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Avoiding surrogate keys  (Richard Broersma <richard.broersma@gmail.com>)
Список pgsql-general
the rule of thumb for me is:
 - if you have more than one column as PK - and are variable length,
or more than 2 columns, fixed length, no bigger than 8 bytes -  go for
surrogate - always.
 - if PK is variable length, on average longer than 8 bytes, or can
change - go surrogate.
 - Otherwise leave it as it is.

At the end of a day, joining tables, using that have more than 1
variable length key, kills performance. In essence it makes index
search a PITA, and should be avoided.


This should always be however decision based on query performance,
usage, and data types. Never a textbook A or B type of thing.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg9 beta1, make check fails
Следующее
От: Andy Colson
Дата:
Сообщение: Re: pg9 beta1, make check fails