182 lines
11 KiB
HTML
182 lines
11 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html lang="en-us" xml:lang="en-us">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="security" content="public" />
|
|
<meta name="Robots" content="index,follow" />
|
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
|
<meta name="DC.Type" content="reference" />
|
|
<meta name="DC.Title" content="Example: Implicitly shared access paths" />
|
|
<meta name="abstract" content="This example shows how to implicitly share access path." />
|
|
<meta name="description" content="This example shows how to implicitly share access path." />
|
|
<meta name="DC.subject" content="implicit access path sharing, access path, sharing, implicit, implicit access path, example" />
|
|
<meta name="keywords" content="implicit access path sharing, access path, sharing, implicit, implicit access path, example" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbafoshrap.htm" />
|
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
|
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
|
|
<meta name="DC.Format" content="XHTML" />
|
|
<meta name="DC.Identifier" content="rbafoiapse" />
|
|
<meta name="DC.Language" content="en-us" />
|
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
|
<!-- US Government Users Restricted Rights -->
|
|
<!-- Use, duplication or disclosure restricted by -->
|
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
|
<title>Example: Implicitly shared access paths</title>
|
|
</head>
|
|
<body id="rbafoiapse"><a name="rbafoiapse"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Example: Implicitly shared access paths</h1>
|
|
<div><p>This example shows how to implicitly share access path.</p>
|
|
<div class="section"><p>Two logical files, LFILE1 and LFILE2, are built over the physical
|
|
file PFILE. LFILE1, which was created first, has two key fields, KFD1 and
|
|
KFD2. LFILE2 has three key fields, KFD1, KFD2, and KFD3. The two logical files
|
|
use two of the same key fields, but no access path is shared because the logical
|
|
file with three key fields was created after the file with two key fields.</p>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="hsides" border="0" rules="none"><caption>Table 1. Physical
|
|
and logical files before save and restore</caption><thead align="left"><tr><th align="center" valign="bottom" width="14.393939393939394%" class="firstcol" id="d0e42"> </th>
|
|
<th align="center" valign="bottom" width="28.535353535353536%" id="d0e43">Physical file (PFILE)</th>
|
|
<th align="center" valign="bottom" width="28.535353535353536%" id="d0e45">Logical file 1 (LFILE1)</th>
|
|
<th align="center" valign="bottom" width="28.535353535353536%" id="d0e47">Logical file 2 (LFILE2)</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr><th align="center" valign="top" width="14.393939393939394%" class="firstcol" id="d0e51" headers="d0e42 ">Access Path</th>
|
|
<td align="center" valign="top" width="28.535353535353536%" headers="d0e51 d0e43 "> </td>
|
|
<td align="center" valign="top" width="28.535353535353536%" headers="d0e51 d0e45 ">KFD1, KFD2</td>
|
|
<td align="center" valign="top" width="28.535353535353536%" headers="d0e51 d0e47 ">KFD1, KFD2, KFD3</td>
|
|
</tr>
|
|
<tr><th align="center" valign="top" width="14.393939393939394%" class="firstcol" id="d0e59" headers="d0e42 ">Fields</th>
|
|
<td align="center" valign="top" width="28.535353535353536%" headers="d0e59 d0e43 ">KFD1, KFD2, KFD3, A, B, C, D, E, F, G</td>
|
|
<td align="center" valign="top" width="28.535353535353536%" headers="d0e59 d0e45 ">KFD1, KFD2, KFD3, F, C, A</td>
|
|
<td align="center" valign="top" width="28.535353535353536%" headers="d0e59 d0e47 ">KFD1, KFD2, KFD3, D, G, F, E</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="section"><p>An application uses LFILE1 to access the records and to change
|
|
the KFD3 field to blank if it contains a C, and to a C if it is blank. This
|
|
application causes the user no unexpected results because the access paths
|
|
are not shared. However, after a save and restore of the physical file and
|
|
both logical files, the program appears to do nothing and takes longer to
|
|
process.</p>
|
|
</div>
|
|
<div class="section"><div class="p">Unless you do something to change the restoration, the <span class="keyword">iSeries™</span> system: <ul><li>Restores the logical file with the largest number of keys first</li>
|
|
<li>Does not build unnecessary access paths</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="section"><p>Because it has three key fields, LFILE2 is restored first. After
|
|
recovery, LFILE1 implicitly shares the access path for LFILE2. Users who do
|
|
not understand implicitly shared access paths do not realize that when they
|
|
use LFILE1 after a recovery, they are really using the key for LFILE2.</p>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="hsides" border="1" rules="rows"><caption>Table 2. Physical
|
|
and logical files after save and restore. Note that the only difference
|
|
from before the save and restore is that the logical files now share the same
|
|
access path.</caption><thead align="left"><tr><th align="center" valign="bottom" width="14.393939393939394%" class="firstcol" id="d0e97"> </th>
|
|
<th align="center" valign="bottom" width="28.535353535353536%" id="d0e98">Physical file (PFILE)</th>
|
|
<th align="center" valign="bottom" width="28.535353535353536%" id="d0e100">Logical file 1 (LFILE1)</th>
|
|
<th align="center" valign="bottom" width="28.535353535353536%" id="d0e102">Logical file 2 (LFILE2)</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr><th align="center" valign="top" width="14.393939393939394%" class="firstcol" id="d0e106" headers="d0e97 ">Access Path</th>
|
|
<td align="center" valign="top" width="28.535353535353536%" headers="d0e106 d0e98 "> </td>
|
|
<td align="center" valign="top" width="28.535353535353536%" headers="d0e106 d0e100 ">KFD1, KFD2, KFD3</td>
|
|
<td align="center" valign="top" width="28.535353535353536%" headers="d0e106 d0e102 ">KFD1, KFD2, KFD3</td>
|
|
</tr>
|
|
<tr><th align="center" valign="top" width="14.393939393939394%" class="firstcol" id="d0e114" headers="d0e97 ">Fields</th>
|
|
<td align="center" valign="top" width="28.535353535353536%" headers="d0e114 d0e98 ">KFD1, KFD2, KFD3, A, B, C, D, E, F, G</td>
|
|
<td align="center" valign="top" width="28.535353535353536%" headers="d0e114 d0e100 ">KFD1, KFD2, KFD3, F, C, A</td>
|
|
<td align="center" valign="top" width="28.535353535353536%" headers="d0e114 d0e102 ">KFD1, KFD2, KFD3, D, G, F, E</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="section"><p>The records to be tested and changed contain:</p>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="hsides" border="0" rules="none"><thead align="left"><tr><th align="center" valign="top" width="25%" id="d0e133">Relative record</th>
|
|
<th align="center" valign="top" width="25%" id="d0e135">KFD1</th>
|
|
<th align="center" valign="top" width="25%" id="d0e137">KFD2</th>
|
|
<th align="center" valign="top" width="25%" id="d0e139">KFD3</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr><td align="center" valign="top" width="25%" headers="d0e133 ">001</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e135 ">01</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e137 ">01</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e139 "><blank></td>
|
|
</tr>
|
|
<tr><td align="center" valign="top" width="25%" headers="d0e133 ">002</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e135 ">01</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e137 ">01</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e139 "><blank></td>
|
|
</tr>
|
|
<tr><td align="center" valign="top" width="25%" headers="d0e133 ">003</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e135 ">01</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e137 ">01</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e139 "><blank></td>
|
|
</tr>
|
|
<tr><td align="center" valign="top" width="25%" headers="d0e133 ">004</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e135 ">01</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e137 ">01</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e139 "><blank></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="section"><p>The first record is read via the first key of 0101<blank>
|
|
and changed to 0101C. The records now look like this:</p>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="hsides" border="0" rules="none"><thead align="left"><tr><th align="center" valign="top" width="25%" id="d0e189">Relative record</th>
|
|
<th align="center" valign="top" width="25%" id="d0e191">KFD1</th>
|
|
<th align="center" valign="top" width="25%" id="d0e193">KFD2</th>
|
|
<th align="center" valign="top" width="25%" id="d0e195">KFD3</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr><td align="center" valign="top" width="25%" headers="d0e189 ">001</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e191 ">01</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e193 ">01</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e195 ">C</td>
|
|
</tr>
|
|
<tr><td align="center" valign="top" width="25%" headers="d0e189 ">002</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e191 ">01</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e193 ">01</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e195 "><blank></td>
|
|
</tr>
|
|
<tr><td align="center" valign="top" width="25%" headers="d0e189 ">003</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e191 ">01</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e193 ">01</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e195 "><blank></td>
|
|
</tr>
|
|
<tr><td align="center" valign="top" width="25%" headers="d0e189 ">004</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e191 ">01</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e193 ">01</td>
|
|
<td align="center" valign="top" width="25%" headers="d0e195 "><blank></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="section"><p>When the application issues a get next key, the next higher key
|
|
above 0101<blank> is 0101C. This is the record that was just changed.
|
|
However, this time the application changes the KFD3 field from C to blank.</p>
|
|
</div>
|
|
<div class="section"><p>Because the user does not understand implicit access path sharing,
|
|
the application accesses and changes every record twice. The end result is
|
|
that the application takes longer to run, and the records look like they have
|
|
not changed.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafoshrap.htm" title="When two or more files are based on the same physical files and the same key fields in the same order, they automatically share the same keyed sequence access path. When access paths are shared, the amount of system activity required to maintain access paths and the amount of auxiliary storage used by the files is reduced.">Use existing access paths</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |