In message <[EMAIL PROTECTED]> Tony Finch writes:
: Dag-Erling Smorgrav <[EMAIL PROTECTED]> wrote:
: >
: >If you only have half a million users, pick a prime number K close to
: >the square root of the expected number of users (724 in your case -
: >closest primes are 719 and 727), create that many bucket directories,
: >and place each user in bucket ID mod K.
: 
: Why a prime number? All you need is an even spread, and given that
: user IDs are usually allocated sequentially any modulus will do.

Because Knuth has shown that prime numbers give the best spread in
hash lookup tables.

Warner


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to