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

124 lines
7.4 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="Radix index scan" />
<meta name="abstract" content="A radix index scan operation is used to retrieve the rows from a table in a keyed sequence. Like a Table Scan, all of the rows in the index will be sequentially processed, but the resulting row numbers will be sequenced based upon the key columns." />
<meta name="description" content="A radix index scan operation is used to retrieve the rows from a table in a keyed sequence. Like a Table Scan, all of the rows in the index will be sequentially processed, but the resulting row numbers will be sequenced based upon the key columns." />
<meta name="DC.subject" content="definitions, radix index scan access method, radix index scan, access method, index, scan access method, access method" />
<meta name="keywords" content="definitions, radix index scan access method, radix index scan, access method, index, scan access method, access method" />
<meta name="DC.Relation" scheme="URI" content="perf21b.htm" />
<meta name="DC.Relation" scheme="URI" content="ipuc.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="rzajqindscan" />
<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>Radix index scan</title>
</head>
<body id="rzajqindscan"><a name="rzajqindscan"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Radix index scan</h1>
<div><p>A radix index scan operation is used to retrieve the rows from
a table in a keyed sequence. Like a Table Scan, all of the rows in the index
will be sequentially processed, but the resulting row numbers will be sequenced
based upon the key columns.</p>
<div class="section"><p>The sequenced rows can be used by the optimizer to satisfy a portion
of the query request (such as ordering or grouping). They can be also used
to provide faster throughput by performing selection against the index keys
rather than all the rows in the table. Since the I/Os associated with the
index will only contain the index keys, typically more rows can be paged into
memory in one I/O against the index than the rows from a table with a large
number of columns.</p>
</div>
<div class="section">
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><caption>Table 1. Radix index scan attributes</caption><thead align="left"><tr><th valign="top" width="31.979695431472084%" id="d0e44">Data access method</th>
<th valign="top" width="68.02030456852792%" id="d0e46">Radix index scan</th>
</tr>
</thead>
<tbody><tr><td valign="top" width="31.979695431472084%" headers="d0e44 "><strong>Description</strong></td>
<td valign="top" width="68.02030456852792%" headers="d0e46 ">Sequentially scan and process all of the keys associated
with the index. Any selection is applied to every key value of the index before
a table row </td>
</tr>
<tr><td valign="top" width="31.979695431472084%" headers="d0e44 "><strong>Advantages</strong></td>
<td valign="top" width="68.02030456852792%" headers="d0e46 "><ul><li>Only those index entries that match any selection continue to be processed</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="d0e44 "><strong>Considerations</strong></td>
<td valign="top" width="68.02030456852792%" headers="d0e46 ">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="d0e44 "><strong>Likely to be used</strong></td>
<td valign="top" width="68.02030456852792%" headers="d0e46 "><ul><li>When asking for or expecting only a few rows to be returned from the index </li>
<li>When sequencing the rows is required for the query (for example, ordering
or grouping) </li>
<li>When the selection columns cannot be matched against the leading key columns
of the index </li>
</ul>
</td>
</tr>
<tr><td valign="top" width="31.979695431472084%" headers="d0e44 "><strong>Example SQL statement</strong></td>
<td valign="top" width="68.02030456852792%" headers="d0e46 "><pre>CREATE INDEX X1 ON Employee (LastName, WorkDept)
SELECT * FROM Employee
WHERE WorkDept BETWEEN 'A01' AND 'E01'
ORDER BY LastName
OPTIMIZE FOR 30 ROWS</pre>
</td>
</tr>
<tr><td valign="top" width="31.979695431472084%" headers="d0e44 "><strong>Messages indicating use</strong></td>
<td valign="top" width="68.02030456852792%" headers="d0e46 "><ul><li>Optimizer Debug: <pre> CPI4328 -- Access path of file X1 was used by query.</pre>
</li>
<li>PRTSQLINF: <pre> SQL4008 -- Index X1 used for table 1.</pre>
</li>
</ul>
</td>
</tr>
<tr><td valign="top" width="31.979695431472084%" headers="d0e44 "><strong>SMP parallel enabled</strong></td>
<td valign="top" width="68.02030456852792%" headers="d0e46 ">Yes</td>
</tr>
<tr><td valign="top" width="31.979695431472084%" headers="d0e44 "><strong>Also referred to as</strong></td>
<td valign="top" width="68.02030456852792%" headers="d0e46 ">Index Scan <p>Index Scan, Preload</p>
<p>Index Scan,
Distinct</p>
<p>Index Scan Distinct, Preload</p>
<p>Index Scan, Key Selection</p>
</td>
</tr>
<tr><td valign="top" width="31.979695431472084%" headers="d0e44 "><strong>Visual Explain icon</strong></td>
<td valign="top" width="68.02030456852792%" headers="d0e46 "><br /><img src="rzajq507.gif" alt="Radix index scan icon" /><br /></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="perf21b.htm" title="An SQL index (or keyed sequence access path) is a permanent object that is created over a table and used by the optimizer to provide a sequenced view of the data for a scan or probe operation.">Radix index</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="ipuc.htm" title="Some complex queries can perform better by using a sort or hashing method to evaluate the query instead of using or creating an index.">Effects of the ALWCPYDTA parameter on database performance</a></div>
</div>
</div>
</body>
</html>