On Wed, Jul 14, 2010 at 03:17:52PM +0200, Stefan de Konink wrote:
Since my first courses in SQL, that was PostgreSQL at the time. It was a strong advise always try to normalise duplications of data, because it would always increase your search preformance to look up numerical keys over string comparisons.
I can't figure out if you're actually asking about normalisation or, what sounds more likely to me, natural vs. surrogate keys? You seem to mention about aspects of both and that's confusing things for me. What to use for keys depends very much on the use case and there aren't any hard and fast rules here. I *personally* prefer to use natural keys where ever possible, but it depends a lot on the use case and sometimes surrogate keys are a better fit for the problem domain. I certainly used to use surrogate keys more often than I do now. -- Sam http://samason.me.uk/