HP3000-L Archives

October 1999, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
James Clark <[log in to unmask]>
Reply To:
James Clark <[log in to unmask]>
Date:
Mon, 18 Oct 1999 21:18:44 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (67 lines)
Image in and of itself is not optimized. HP which wrote MPE and Image linked
to two together for the benefit of both. The memory manager keeps track of
the dirty pages in memory and what data it currently has in memory. Image
just keep track of locks and integrity and links of the data, hands it to
the memory manager and trust it to do its job.
In general serially reading a dataset is always faster than key reading the
same set. Yet some situations call for key reading. The situation is such:
if I have 100000 records with a blocking factor of 10, then serially reading
the set will take approximatly 10000 physical disc reads. But with a keyed
read, the best I could do is 10000 but more likely 50000 to the worst case
of 100000 physical disc reads. Of course, the above serial read is limited
to only one page/block. If buffers allow, multiple blocks could be read at a
time thus improving further.
The situation fails when, due to looking for data, you have to repeatedly
serially read the data. As in your example, did I read the last invoice for
said customer #, let me read to end to be sure. Unless of course, upon
finding first record, you know about the data and know it is the only one.
So having said the above, and to answer your question. The disc optimization
is within the memory manager and buffers of Image. If you do a DBFIND &
DBGET pair, Image will go through the same code each time, but when going to
disc it will instead go to the memory manager to ask if it has the data. If
in memory, then no disk is read and the data if forwarded to the App.
Hope this helps.

James

-----Original Message-----
From: HP-3000 Systems Discussion [mailto:[log in to unmask]]On
Behalf Of Jim Phillips
Sent: Monday, October 18, 1999 5:42 PM
To: [log in to unmask]
Subject: Image Optimization


Does Image optimize data access?

What I have in mind is:

I'm reading a data set of invoices that have the customer number in them.
The primary key for the invoices is invoice number, and one invoice number
pertains to only one customer number. I need to read the invoices serially
because I'm selecting by invoice date, which is not a key item.  As I'm
reading the invoices, I need to jump out to the customer data set and get
some info about the customer.  Should I code something like this:

DBGET Mode 2 Invoice

If Invoice.Cust# <> Customer.Cust# then
    DBFIND Mode 1 Customer
    DBGET Mode 5 Customer
End-If

The purpose of this code is to eliminate an unnecessary DBFIND/DBGET to the
customer data set if that customer's record is already in memory.  What I
want to know is should I code this, or does Image do something like this
already?  IOW, if I do the DBFIND/DBGET every single time, am I wasting
resources by forcing Image to re-read a record that may be in memory
already, or is Image smart enough to not do the record retrieval if the
record is already in memory?

Thanks, as always, for any assistance.

Jim Phillips                            Manager of Information Systems
E-Mail: [log in to unmask]     Therm-O-Link, Inc.
Phone: (330) 527-2124                   P. O. Box 285
  Fax: (330) 527-2123                   Garrettsville, Ohio  44231

ATOM RSS1 RSS2