george young <gry@ll.mit.edu> writes:
> The question is: would I be better off losing all those integer ids
> and just using the text names as primary indices? Is there much
> performance lost comparing text strings for every index operation?
Strings would be slower, but possibly not by enough to notice. The
real question you should ask yourself is whether your text names are
really good candidates to be primary keys. Are there ever any
duplicates? Do you ever rename objects? If your answer to either
is "yes" then the names won't do as unique identifiers.
There's an old saying that meaningful keys are bad database design;
check the mailing list archives for some examples. (F'r instance,
I seem to recall a story about a bank that embedded branch numbers
into account numbers, and then had terrible troubles anytime a
customer moved...)
regards, tom lane