Ian Lance Taylor <[EMAIL PROTECTED]> wrote:
>If the input numbers are truly random, then a modulos hash will
>distribute well whether or not the hash size is prime.
>
>However, if the input numbers are not truly random, then a modulos
>hash may pick out some regularity in the input, and preferentially
>hash to a given set of buckets.
If the input numbers are not fairly random, then a modulo hash is not
a choice.
>For a trivial example, if the numbers
>tend to be even, then an even modulos hash will tend toward using the
>even numbered buckets.
Which, unfortunately, wouldn't be helped by a prime table size.
>A prime modulos hash minimizes the types of
>regularity which will lead to a poor hash distribution.
Exactly how does a prime modulus help? Can you give an example?
>Unix file system inode numbers are not truly random. Therefore, it's
>wise to choose a prime conf-split.
I'm still not convinced.
Has anyone ever seen a problem with a non-prime conf-split that was
significantly helped by switching to a prime conf-split?
-Dave