From owner-freebsd-hackers Wed Dec 13 15: 3:11 2000 From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 13 15:03:09 2000 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 93EF937B404 for ; Wed, 13 Dec 2000 15:03:08 -0800 (PST) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.0/8.11.0) with ESMTP id eBDN37s82637; Wed, 13 Dec 2000 16:03:07 -0700 (MST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id QAA42413; Wed, 13 Dec 2000 16:03:03 -0700 (MST) Message-Id: <200012132303.QAA42413@harmony.village.org> To: Tony Finch Subject: Re: very big mail spool directory Cc: Dag-Erling Smorgrav , Gustavo Vieira Goncalves Coelho Rios , hackers@FreeBSD.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> Date: Wed, 13 Dec 2000 16:03:03 -0700 From: Warner Losh Sender: imp@harmony.village.org Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <20001213214404.P71002@hand.dotat.at> Tony Finch writes: : Dag-Erling Smorgrav 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