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

105 lines
7.6 KiB
HTML
Raw 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" />
<meta name="abstract" content="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." />
<meta name="description" content="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." />
<meta name="DC.subject" content="definitions, temporary index access method, temporary index, access method, index, temporary access method, access method" />
<meta name="keywords" content="definitions, temporary index access method, temporary index, access method, index, temporary access method, access method" />
<meta name="DC.Relation" scheme="URI" content="rzajqtempobj.htm" />
<meta name="DC.Relation" scheme="URI" content="rzajqtempinscan.htm" />
<meta name="DC.Relation" scheme="URI" content="rzajqtempinprobe.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="rzajqtempindex" />
<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</title>
</head>
<body id="rzajqtempindex"><a name="rzajqtempindex"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Temporary index</h1>
<div><p>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 <span class="cmdname">Create Logical
File (CRTLF)</span> CL command.</p>
<div class="section"><p>Additionally, the temporary index is optimized for use by the
optimizer to satisfy a specific query request. This includes setting the logical
page size and applying any selection to the creation to speed up the use of
the temporary index after it has been created. </p>
</div>
<div class="section"><img src="./delta.gif" alt="Start of change" /><p>The temporary index can be used to satisfy a variety
of query requests:</p>
<ul><li>Ordering</li>
<li>Grouping/Distinct</li>
<li>Joins</li>
<li>Record selection</li>
</ul>
<img src="./deltaend.gif" alt="End of change" /></div>
<div class="section"><p>Generally a temporary index is a more expensive temporary object
to create than other temporary objects. It can be populated by either performing
a table scan to fetch the rows to be used for the index or by performing an
index scan or probe against one or more indexes to produce the rows. The optimizer
considers all of the methods available when determining which method to use
to produce the rows for the index creation. This process is similar to the
costing and selection of the other temporary objects used by the optimizer.</p>
</div>
<div class="section"><p>One significant advantage of the temporary index over the other
forms of temporary objects is that the temporary index is the only form of
a temporary object that is maintained if the underlying table changes. The
temporary index is identical to a radix index in that as any inserts or updates
are performed against the table, those changes are reflected immediately within
the temporary index through the normal index maintenance processing. </p>
<p><img src="./delta.gif" alt="Start of change" />SQE usage of temporary indexes is different than CQE usage in that
SQE allows reuse. References to temporary indexes created and used by the
SQE optimizer are kept in the system Plan Cache. A temporary index is saved
for reuse by other instances of the same query or other instances of the same
query running in a different job. It is also saved for potential reuse by
a different query that can benefit from the use of the same temporary index.
By default, a SQE temporary index persists until the Plan Cache entry for
the last referencing query plan is removed. You can control this behavior
by setting the CACHE_RESULTS QAQQINI value. The default for
this INI value allows the optimizer to keep temporary indexes around for reuse.
Changing the INI value to '*JOB' prevents the temporary index from being saved
in the Plan Cache; the index does not survive a hard close. The *JOB option
causes SQE optimizer use of temporary indexes to behave more like CQE optimizer;
it becomes shorter lived, but still shared as long as there are active queries
using it. This behavior can be desirable in cases where there is concern about
increased maintenance costs for temporary indexes that persist for reuse.<img src="./deltaend.gif" alt="End of change" /></p>
</div>
<div class="section"><p>A temporary index is an internal data structure and can only be
created by the database manager.</p>
</div>
<div class="section"><p>Visual explain icon:</p>
</div>
<div class="section"><p><img src="rzajq529.gif" alt="Temporary radix index icon" /></p>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="rzajqtempinscan.htm">Temporary index scan</a></strong><br />
A temporary index scan operation is identical to the index scan operation that is performed upon the permanent radix index. It is still used to retrieve the rows from a table in a keyed sequence; however, the temporary index object must first be created. All of the rows in the index will be sequentially processed, but the resulting row numbers will be sequenced based upon the key columns.</li>
<li class="ulchildlink"><strong><a href="rzajqtempinprobe.htm">Temporary index probe</a></strong><br />
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.</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzajqtempobj.htm" title="Temporary objects are created by the optimizer in order to process a query. In general, these temporary objects are internal objects and cannot be accessed by a user.">Temporary objects and access methods</a></div>
</div>
</div>
</body>
</html>