    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
     <channel>
        <title>ACCU  :: The Wall</title>
        <link>https://members.accu.org/index.php/journals/965</link>
        <description>Professionalism in Programming</description>
        <dc:language>en-us</dc:language> 
        <dc:creator>Administrator</dc:creator> 
        <admin:generatorAgent rdf:resource="http://www.xaraya.org" /> 
        <admin:errorReportsTo rdf:resource="mailto:webeditor@accu.org" />
       <sy:updatePeriod>hourly</sy:updatePeriod>
       <sy:updateFrequency>1</sy:updateFrequency>
       <docs>http://backend.userland.com/rss</docs>


        <h2>Journal Articles</h2>


<div class="xar-mod-head"><span class="xar-mod-title">CVu Journal Vol 12, #1 - Jan 2000 + Letters to the Editor</span></div>

<table border="0" cellpadding="1" cellspacing="0">
    <tbody>
    <tr>
        <td valign="top">
            Browse in :
       </td>
       <td valign="top">

                                            <a href="https://members.accu.org/index.php/journals/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c76/">Journals</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c77/">CVu</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c128/">121</a>
                    (30)
<br />

                                            <a href="https://members.accu.org/index.php/journals/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c184/">Journal Columns</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c186/">LettersEditor</a>
                    (132)
<br />

                                            <a href="https://members.accu.org/index.php/journals/c128-186/">Any of these categories</a>

                    -                        <a href="https://members.accu.org/index.php/journals/c128+186/">All of these categories</a>
<br />
</td>
   </tr>
   </tbody>
</table>




<div class="xar-error">
   <p>
 <strong>Note:</strong> when you create a new publication type,
the articles module will automatically use the templates
<em>user-display-[publicationtype].xt</em>
and <em>user-summary-[publicationtype].xt</em>.
If those templates do not exist when you try to preview or display a new article,
you'll get this warning :-)  Please place your own templates in themes/<em>yourtheme</em>/modules/articles . The templates will get the extension .xt there. </p>
</div>
<div class="xar-norm xar-standard-box-padding">
   <h1><strong>Title:</strong>&nbsp;The Wall</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 08 January 2000 13:15:34 +00:00 or Sat, 08 January 2000 13:15:34 +00:00</p>
<p><strong>Summary:</strong>&nbsp;</p>
<p><strong>Body:</strong>&nbsp;<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e22" id="d0e22"></a>And Another
View</h2>
</div>
<p>Dear Francis,</p>
<p>After the demands of a new job and moving house, I've finally
had time to think about the last C Vu. The article by Waldo Posul
caught my attention because while you can't do what he's asking,
you can achieve the effect by some abstraction of the problem.</p>
<p>For the sake of this example, I'm assuming a disc file of 10GB,
with small fixed length records of a few KB or less. The
requirement is to be able to create/read/maintain a disc index to
the records in the datafile such that the file can be accessed in
reasonable time. I'll leave a definition of 'reasonable' open, but
the process can be speeded up considerably over the example given
in the article. As the article states, the fgetpos() return cannot
be stored beyond the life of the associated stream with any
guarantee of success.</p>
<p>My approach would be to forgo the actual file offset in favour
of a record number in the index file.</p>
<p>An index file needs to contain as a minimum the key field and
the record number in the file. This gives us the logical place to
look, but not the physical offset.</p>
<p>The datafile should be accessed in chunks as large as memory
will permit. The chunk must be some exact multiple of the record
size. A 64Kb chunk is only 1/160th of our 10GB file, and for small
records that is a considerable reduction of overhead from reading
one record at a time. The program loop is slow compared to the disc
to memory transfer. From the record number and the number of
records that fit in your chunk, you know which chunk to read, and
then you extract the record by knowing the offset into the chunk.
True, you still have to read all the chunks to get to the last
record.</p>
<p>By caching the fgetpos() returns for each chunk as it is
required, but not before, you reduce your startup overhead at the
expense of a variable initial access time to any specific record.
If memory permits, you can cache recently used chunks to further
improve performance.</p>
<p>The original indexed sequential access method used an access
scheme that was directly related to the location of the record on
the storage medium. This isn't possible on current general-purpose
filesystems. However, by abstracting the problem to a higher level
you can achieve a similar end.</p>
<p>There may be some performance gains to be obtained by using
setvbuf() to tune the stream I/O to the chunk size, or some
fraction of it, but I regard that as a late optimisation.</p>
<p>I do have to ask why a large single file is being used for small
records, rather than use an index scheme of key, file, record that
will fit in the original long int specification.</p>
<p>Graham Patterson <tt class="email">&lt;<a href=
"mailto:grahamp@econ.Berkeley.EDU">grahamp@econ.Berkeley.EDU</a>&gt;</tt></p>
<p class="c3"><span class="remark">Good to hear from you. I hope
you will now have time to write more regularly.</span></p>
<p class="c3"><span class="remark">For newcomers, Graham is a
long-term member of ACCU having held office as both Secretary and
Treasurer who moved to California earlier this year.</span></p>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
