| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера