Article View: news.software.nntp
Article #84262Re: Is getting article by Message ID inherently slower than by Article Number?
From: Jonathan de Boyne Pollard
Date: Sun, 14 Aug 2011 20:33
Date: Sun, 14 Aug 2011 20:33
47 lines
4374 bytes
4374 bytes
> By article number: Most news servers maintain an index of some sort of > all articles in a group, with high and low watermarks. Therefore, the > articles in a group can form an array (if variable data, an array of > fixed pointers could be used). Therefore, the article number less the > low watermark can be used as a direct index into a fixed array, thus > retrieving the article pointer in a search of time "order(1)." This > assumes that expired articles between the watermarks occupy array > element locations until they become out of range. Otherwise, the > search will be order(log2(n)) - i.e equivalent to a strict binary tree > search since the array is usually kept in sorted order. > That analysis is flawed, lacking as it does some real world factors. The first is that the "index of some sort" in at least some news spools is just the filesystem. Each article number is simply a directory entry, in a directory named after the newsgroup. The access to the article thus depends from the filesystem format used for the disc volume containing the news spool. An old Unix filesystem format with a simple linear directory isn't going to be particularly efficient about finding article number 27069 of 27070, for example, and certainly isn't going to do that in order(1) time. It's vitally important to factor in the news spool structure and the filesystem format. > By message ID: Most news servers maintain a list of message IDs of all > [recent] articles on the server which is group independent. As this is > generally an UNSORTED list, searching takes order(n * log(n)) time on > average to find the entry with the article storage pointer. > Again, this misses out the real world factors. I know of at least one server that handles message ID lookup pretty much as article number lookup above: it uses the filesystem as the database, and a simple two-level directory structure. So, once again, the filesystem format enters into the picture with considerable effect, and needs to be accounted for. A directory lookup of "$SPOOL/snarked.org/j1qkob\$jjd\$1" is going to be quicker on a filesystem with a B-tree-structured directory layout (HPFS, NTFS, and so forth) than on a filesystem with a simple linear directory layout. M. "drek" was quite right to say: > Without specifying the software and methodology used in the comparison > I don't see how anyone in this group could give a meaningful answer. > Indeed, M. "MM" xyrself said that this all was: > depending on what kind of database is implemented >
Technical Details
Message-ID:
<IU.D20110814.T203452.P7839.Q0@J.de.Boyne.Pollard.localhost>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!news-transit.tcx.org.uk!cyclone01.ams2.highwinds-media.com!news.highwinds-media.com!voer-me.highwinds-media.com!npeersf01.ams.highwinds-media.com!newsfe22.ams2.POSTED!00000000!not-for-mailReferences:
<97vs37plvqd467e3k8ipincoo6qm5a29kc@4ax.com> <he0t37l6cali01lr8rternu2js5hcobnhq@4ax.com> <4m4t37tcfcs9d57e60ctb8gubh0fb42sa7@4ax.com> <6s5147tefb7t0r5pmmnvqoa3j74qh15ukk@4ax.com> <j1qkob$jjd$1@snarked.org>Show Full Headers
Complete Article Headers
Message-ID: <IU.D20110814.T203452.P7839.Q0@J.de.Boyne.Pollard.localhost> Subject: Re: Is getting article by Message ID inherently slower than by Article Number? Date: Sun, 14 Aug 2011 21:33:50 +0100 From: Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.COM> References: <97vs37plvqd467e3k8ipincoo6qm5a29kc@4ax.com> <he0t37l6cali01lr8rternu2js5hcobnhq@4ax.com> <4m4t37tcfcs9d57e60ctb8gubh0fb42sa7@4ax.com> <6s5147tefb7t0r5pmmnvqoa3j74qh15ukk@4ax.com> <j1qkob$jjd$1@snarked.org> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!news-transit.tcx.org.uk!cyclone01.ams2.highwinds-media.com!news.highwinds-media.com!voer-me.highwinds-media.com!npeersf01.ams.highwinds-media.com!newsfe22.ams2.POSTED!00000000!not-for-mail User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 Newsgroups: news.software.nntp,alt.usenet.offline-reader.forte-agent In-Reply-To: <j1qkob$jjd$1@snarked.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Lines: 47 NNTP-Posting-Host: 86.20.254.174 X-Complaints-To: http://netreport.virginmedia.com X-Trace: newsfe22.ams2 1313355955 86.20.254.174 (Sun, 14 Aug 2011 21:05:55 UTC) NNTP-Posting-Date: Sun, 14 Aug 2011 21:05:55 UTC Organization: virginmedia.com X-Original-Bytes: 4117