Article View: news.software.nntp
Article #19090Re: Most efficient directory structure for news?
From: Ian Stirling
Date: Tue, 08 Jul 1997 00:00
Date: Tue, 08 Jul 1997 00:00
49 lines
3123 bytes
3123 bytes
Forrest J. Cavalier III <mibsoft@epix.net> wrote: : In article <5pq0fa$rpv@stealth.eng.pyramid.com>, mark@stealth.eng.pyramid.com : wrote... : > : [snip] : > I actually put an overall hash scheme in for news storage. Basically, : >we generate a 32 bit hash code from the message id, and store it based : >on that. the 32 bit is actually overkill, so I am only use 16 of those : >bits for the directorys (xx/xx/article) storage. This gives 65536 : >directories for all the news. <snip> : The probability of collision is non-zero. (1 in 2400 if you assume : 32 bit hash, 600K articles x 3 day retention.) This could mean that a 600K*3=21 bits (I think) It's not 1 in 2400, it's a dead cert, due to birthday paradox. Basically, in any group of size sqrt(x) selected from x possible states, you have a probability of .5 that there will be two x's of the same value. In classic form, it's more likely than not you will get 2 people with the same birthday in a group of 20 or over. I did some sums, to generate pretty unique hashes (50 billion articles/day, for 1000 years has 1 in a billion probability of any article clashing) you need around 128 bits. : message from alt.binaries.pictures.erotica happens to get stored : over top of something from, say, alt.kids-talk. Or do you handle the : case by not writing over top of existing articles. Some case like if you are about to write over an existing article, mark it in a seperate database. : Forrest Cavalier, Mib Software, INN customization and consulting : >-- : > : >-- Mark Wedel : >mark@pyramid.com -- Ian Stirling. Designing a linux PDA, see http://www.mauve.demon.co.uk/ -----******* If replying by email, check notices in header *******------- Prosperity and ruin issue from the power of the tongue. Therefore, guard yourself against thoughtless speech.
Technical Details
Message-ID:
<000033C29F8E.NO_UCE@mauve.demon.co.uk>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<5pn3ck$137s$1@node17.cwnet.frontiernet.net> <5pq0fa$rpv@stealth.eng.pyramid.com> <5pt6cs$l6l$1@news1.epix.net>Show Full Headers
Complete Article Headers
Message-ID: <000033C29F8E.NO_UCE@mauve.demon.co.uk> Subject: Re: Most efficient directory structure for news? Date: Tue, 08 Jul 1997 00:00:00 +0000 From: Ian Stirling <000033C29F8E.NO_UCE@mauve.demon.co.uk> References: <5pn3ck$137s$1@node17.cwnet.frontiernet.net> <5pq0fa$rpv@stealth.eng.pyramid.com> <5pt6cs$l6l$1@news1.epix.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 255575165 X-Mail2News-User: Send.NO_UCE@mauve.demon.co.uk MMDF-Warning: Parse error in original version of preceding line at punt-1.mail.demon.net X-Warning0: For unsolicited commercial email, sent (or for causing such to be sent) to X-Warning1: the email address on this message, I reserve the right to levy a charge X-Warning2: for my time and expenses of up to 100 pounds sterling per message, plus X-Warning3: 10 pounds per 100 lines of message body, plus legal, penalty or other costs X-Mail2News-Path: punt-1.mail.demon.net!mauve.demon.co.uk X-Note: Anti-UCE in effect, replying should work if you are not UCE'ng Newsgroups: news.software.nntp