Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Dec 2000 16:03:03 -0700
From:      Warner Losh <imp@village.org>
To:        Tony Finch <dot@dotat.at>
Cc:        Dag-Erling Smorgrav <des@ofug.org>, Gustavo Vieira Goncalves Coelho Rios <gustavo@ifour.com.br>, hackers@FreeBSD.ORG
Subject:   Re: very big mail spool directory 
Message-ID:  <200012132303.QAA42413@harmony.village.org>
In-Reply-To: Your message of "Wed, 13 Dec 2000 21:44:04 GMT." <20001213214404.P71002@hand.dotat.at> 
References:  <20001213214404.P71002@hand.dotat.at>  <3A368F8C.1918684F@ifour.com.br> <xzpsnns4jvx.fsf@flood.ping.uio.no> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20001213214404.P71002@hand.dotat.at> Tony Finch writes:
: Dag-Erling Smorgrav <des@ofug.org> 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 majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200012132303.QAA42413>