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.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to