DB2/400
5 pts.
0
Q:
DB2/400
When we do DSPFD for a file it shows physical and logical reads. What is the Difference between physical and logical reads?
ASKED: Sep 15 2009  1:57 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
8025 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
The Physical File contains the data.
It can have a key but it does not have to.
If read without the key it reads in FIFO sequence. You can set a blocking factor and this is the faster way to process the file.

A logical file contains no data. It just has a access path to read the data from the PF.
A LF can cah a key and/or had Select/omit criteria.
In a high level program you must specify that it is a key file or it will read it in FIFO seq.

When using SQL or QRY, and you select an order, those products will look to see if a LF that already exists can bu used to read the file. If not, it creates one on the fly.
------------------------
This sure sounds like a homework question...
we don't want to ruin your educational experience by doing your homework.
Phil

=====================================================

A "physical" read actually transferred data data from external storage into an I/O buffer. A "logical" read accessed a record that was already in an I/O buffer. Data is generally transferred between external storage and memory (buffers) in "blocks". If you compare the size of a block to the size of a record, you might find that, e.g., ten records can fit into a single block. Thus, a "physical" read can transfer ten records. Ten "logical" reads could be done before another physical read was needed.

Note that this is primarily effective for sequentially reading files. If random reads always require fetching different blocks, then physical reads will be perhaps as many as logical reads.

Tom
Last Answered: Oct 9 2009  2:41 AM GMT by TomLiotta   8025 pts.
Latest Contributors: Philpl1jb   24610 pts., CharlieBrowne   6540 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



0