Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!bu.edu!purdue!haven!decuac!shlump.nac.dec.com!news.crl.dec.com!decvax.dec.com!zinn!siia!drd From: drd@siia.mv.com (David Dick) Newsgroups: comp.unix.questions Subject: Re: unix file structure (or lack of same) Keywords: unix, file, database Message-ID: <1990Nov7.160611.9378@siia.mv.com> Date: 7 Nov 90 16:06:11 GMT References: <125379@linus.mitre.org> Organization: Software Innovations, Inc. Lines: 49 In <125379@linus.mitre.org> duncant@mbunix.mitre.org (Thomson) writes: >I'm curious about something: >I understand that, on unix, the file system is designed so that a file always >looks like a sequence of bytes, with no record structure at all. >Is this correct? Yes. >If so, how does one implement an efficient database manager on unix in >a standard, portable, way? To be efficient, a database manager needs to >have random access into files on a record-oriented basis. Why does a database manager need record-level access? Is the calculation of the address of a record going to be more efficient in supervisor mode than in user mode? Doesn't a database manager want to decide exactly where data will be located and how it will be accessed? If the OS provides record-level access *it* will be deciding these things. >that fseek() wouldn't do the job. (Am I wrong here?) If unix doesn'`t >provide a record-oriented view of files, then any database implementation >would have to go below unix, and access the mass storage devices directly. >Is this right? I don't think this is right. Lack of record-level access does not imply the necessity for direct access. Direct access should be used anyway, for efficiency. Besides, UNIX *does* allow access to raw disk, which can be done in a portable way. That's what the feature is for. >I know there are database managers for unix, so there must be ways to >do it.... The real reason to use "raw" disk is to avoid the logical-to-physical mapping that UNIX filesystem code does in order to provide the array-of-bytes model for a file. That mapping provides some overhead that can be avoided by using the raw disk. I don't think a good DBMS implementation should depend on an OS record access implementation; it should access a disk as directly as it can, so whether the OS provides record-level access is irrelevant, IMHO. David Dick Software Innovations, Inc. [the Software Moving Company (sm)]