ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzajq_5.4.0.1/rzajqtempinprobe.htm

133 lines
8.2 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<?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="Temporary index probe" />
<meta name="abstract" content="A temporary index probe operation is identical to the index probe operation that is performed upon the permanent radix index. Its main function is to provide a form of quick access against the index keys of the temporary index; however it can still used to retrieve the rows from a table in a keyed sequence." />
<meta name="description" content="A temporary index probe operation is identical to the index probe operation that is performed upon the permanent radix index. Its main function is to provide a form of quick access against the index keys of the temporary index; however it can still used to retrieve the rows from a table in a keyed sequence." />
<meta name="DC.subject" content="definitions, temporary index probe access method, temporary index, probe access method, index, temporary, access method, temporary index probe" />
<meta name="keywords" content="definitions, temporary index probe access method, temporary index, probe access method, index, temporary, access method, temporary index probe" />
<meta name="DC.Relation" scheme="URI" content="rzajqtempindex.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="rzajqtempinprobe" />
<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>Temporary index probe</title>
</head>
<body id="rzajqtempinprobe"><a name="rzajqtempinprobe"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Temporary index probe</h1>
<div><p>A temporary index probe operation is identical to the index probe
operation that is performed upon the permanent radix index. Its main function
is to provide a form of quick access against the index keys of the temporary
index; however it can still used to retrieve the rows from a table in a keyed
sequence.</p>
<div class="section"><p>The temporary index is used by the optimizer to satisfy the join
portion of the query request. </p>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><caption>Table 1. Temporary index probe attributes</caption><thead align="left"><tr><th valign="top" width="31.979695431472084%" id="d0e42">Data access method</th>
<th valign="top" width="68.02030456852792%" id="d0e44">Temporary index probe</th>
</tr>
</thead>
<tbody><tr><td valign="top" width="31.979695431472084%" headers="d0e42 "><strong>Description</strong></td>
<td valign="top" width="68.02030456852792%" headers="d0e44 ">The index is quickly probed based upon the selection
criteria that were rewritten into a series of ranges. Only those keys that
satisfy the selection will be used to generate a table row number. </td>
</tr>
<tr><td valign="top" width="31.979695431472084%" headers="d0e42 "><strong>Advantages</strong></td>
<td valign="top" width="68.02030456852792%" headers="d0e44 "><ul><li>Only those index entries that match any selection continue to be processed.
Provides very quick access to the selected rows </li>
<li>Potential to extract all of the data from the index keys' values, thus
eliminating the need for a Table Probe</li>
<li>Returns the rows back in a sequence based upon the keys of the index</li>
</ul>
</td>
</tr>
<tr><td valign="top" width="31.979695431472084%" headers="d0e42 "><strong>Considerations</strong></td>
<td valign="top" width="68.02030456852792%" headers="d0e44 ">Generally requires a Table Probe to be performed to
extract any remaining columns required to satisfy the query. Can perform poorly
when a large number of rows are selected because of the random I/O associated
with the Table Probe. </td>
</tr>
<tr><td valign="top" width="31.979695431472084%" headers="d0e42 "><strong>Likely to be used</strong></td>
<td valign="top" width="68.02030456852792%" headers="d0e44 "><ul><li>When the ability to probe the rows required for the query (for example,
joins) exists</li>
<li>When the selection columns cannot be matched against the leading key columns
of the index</li>
<li>When the overhead cost associated with the creation of the temporary index
can be justified against other alternative methods to implement this query</li>
</ul>
</td>
</tr>
<tr><td valign="top" width="31.979695431472084%" headers="d0e42 "><strong>Example SQL statement</strong></td>
<td valign="top" width="68.02030456852792%" headers="d0e44 "><pre>SELET * FROM Employee XXX, Department YYY
WHERE XXX.WorkDept = YYY.DeptNo
OPTIMIZE FOR ALL ROWS </pre>
</td>
</tr>
<tr><td valign="top" width="31.979695431472084%" headers="d0e42 "><strong>Messages indicating use</strong></td>
<td valign="top" width="68.02030456852792%" headers="d0e44 ">There are multiple ways in which a temporary index probe
can be indicated through the messages. The messages in this example illustrate
one example of how the Classic Query Engine will indicate a temporary index
probe was used. <ul><li>Optimizer Debug: <pre>CPI4321 -- Access path built for file DEPARTMENT.
CPI4327 -- File EMPLOYEE processed in join
position 1.
CPI4326 -- File DEPARTMENT processed in join
position 2.</pre>
</li>
<li>PRTSQLINF: <pre>SQL4007 -- Query implementation for join
position 1 table 1.
SQL4010 -- Table scan access for table 1.
SQL4007 -- Query implementation for join
position 2 table 2.
SQL4009 -- Index created for table 2.</pre>
</li>
</ul>
</td>
</tr>
<tr><td valign="top" width="31.979695431472084%" headers="d0e42 "><strong>SMP parallel enabled</strong></td>
<td valign="top" width="68.02030456852792%" headers="d0e44 ">Yes</td>
</tr>
<tr><td valign="top" width="31.979695431472084%" headers="d0e42 "><strong>Also referred to as</strong></td>
<td valign="top" width="68.02030456852792%" headers="d0e44 ">Index Probe <p>Index Probe, Preload</p>
<p>Index Probe,
Distinct</p>
<p>Index Probe Distinct, Preload</p>
<p>Index Probe, Key Selection</p>
</td>
</tr>
<tr><td valign="top" width="31.979695431472084%" headers="d0e42 "><strong>Visual Explain icon</strong></td>
<td valign="top" width="68.02030456852792%" headers="d0e44 "><br /><img src="rzajq531.gif" alt="Temporary index probe" /><br /></td>
</tr>
</tbody>
</table>
</div>
<div class="section"><p>Using the example above, the optimizer chose to create a temporary
index over the DeptNo column to help satisfy the join requirement against
the DEPARTMENT table. A temporary index probe was then performed against the
temporary index to process the join criteria between the two tables. In this
particular case, there was no additional selection that might be applied against
the DEPARTMENT table while the temporary index was being created. </p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzajqtempindex.htm" title="A temporary index is a temporary object that allows the optimizer to create and use a radix index for a specific query. The temporary index has all of the same attributes and benefits as a radix index that is created by a user through the CREATE INDEX SQL statement or Create Logical File (CRTLF) CL command.">Temporary index</a></div>
</div>
</div>
</body>
</html>