Subject Re: [firebird-support] searching a varchar(100) column
Author Ann W. Harrison
Alan McDonald wrote:
> too much disk space/DB pages used for the index. you're always better off
> here with a surrogate integer key as PK. Comments?

I like surrogate primary keys because everything else I try to use -
however seemingly stable and unique turns out to change or produce
duplicates. However, there's nothing wrong with an index on a string -
even a long one. Index keys have both suffix and prefix compression, so
the trailing blanks are gone and so are the characters at the front that
duplicate the previous key. If you look at the average key length -
(use gstat) you'll find that in most indexes its very small - much
smaller than the fields being indexed.