On 1 Feb 2005 13:57:18 -0500, Ted Zlatanov <[EMAIL PROTECTED]> wrote: > You can just use the first letters of the user name, that's a pretty > popular scheme: > > 1 level: > k/karolis > t/tzz > > 2 levels: > k/ka/karolis > t/tz/tzz > > and so on... The advantage is that you'll get a fairly even > distribution, and you know exactly where to find any user's Maildir > (with numeric subdirectories, you have to hunt for it or keep a > database).
I currently use this method for some data I store, and it works nice but I don't think I would consider it very balanced. I am using sample data from our customer base and as you would expect hashing this way by domain and/or email address gets very un-even when dealing with names people select. Mainly common letters (like vowels) fill much faster then say w, x, z. I am probably going to impliment a tracked integer id per email address and fill the hash in reverse order. Since the last digit of the id increments it will naturally spread accross the hash. The only factor that will impact the balance is deletion at that point. example: uid: [EMAIL PROTECTED] maildirId: 653033 homeDirectory: /nfs/mailstore/3/3/0/... etc. This has a lot of drawbacks because of the need to track the maildirId, and manage the increment of it. Does anyone else have any other methods they use, and would share? -- Sean
