Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: news.software.b Subject: Re: Why does rnews duplicate its history? Message-ID: <8530@utzoo.UUCP> Date: Mon, 31-Aug-87 16:06:56 EDT Article-I.D.: utzoo.8530 Posted: Mon Aug 31 16:06:56 1987 Date-Received: Mon, 31-Aug-87 16:06:56 EDT References: <125@minya.UUCP> Organization: U of Toronto Zoology Lines: 27 Keywords: news history > Say, I was wondering if anyone out there could explain something that > has had me puzzled for a while. Usenet has, as well known, this "history" > file, and in addition, on this Sys/V machine, it has a history.d directory > that contains files 0 thru 9. Each of these is a subset of "history"... > However, the software as compiled here insists on keeping *both* the > large history file and the 10 little ones. This strikes me as a bit > on the bizarre side. I mean, isn't that getting the worst of both > worlds? ... What you're seeing is a SysV emulation of something that makes a bit more sense in non-SysV Unixes. In the non-SysV world, there's a little library called "dbm" which lets one maintain sort of a symbol table. The point of this is that news can use dbm to find out *quickly* whether an article with a given message-id exists on the system already. Using dbm is *much much* faster than scanning the whole history file, especially in non-SysV systems that historically have rather slow implementations of fgets. The history file provides the authoritative record; dbm's role is to provide fast access. It's worth the price of having to keep both up to date. Unfortunately, there's no dbm in SysV, so it was faked. I don't know whether anybody looked carefully at the tradeoffs in SysV, although the 0-9 split should be cutting search overhead noticeably. The point is that it's not really a duplication of effort -- the main history file and its subsidiaries are specialized for different uses. -- "There's a lot more to do in space | Henry Spencer @ U of Toronto Zoology than sending people to Mars." --Bova | {allegra,ihnp4,decvax,utai}!utzoo!henry