112 lines
7.1 KiB
HTML
112 lines
7.1 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="Enqueue" />
|
||
|
<meta name="abstract" content="During a enqueue operation, an entry it put on the queue that contains key values used by the recursive join predicates or data manipulated as a part of the recursion process. The optimizer always supplies an enqueue operation to collect the required recursive data on the query node directly above the Union All." />
|
||
|
<meta name="description" content="During a enqueue operation, an entry it put on the queue that contains key values used by the recursive join predicates or data manipulated as a part of the recursion process. The optimizer always supplies an enqueue operation to collect the required recursive data on the query node directly above the Union All." />
|
||
|
<meta name="DC.subject" content="definitions, enqueue access method, enqueue, access method, access method" />
|
||
|
<meta name="keywords" content="definitions, enqueue access method, enqueue, access method, access method" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzajqqueue.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="rzajqenqueue" />
|
||
|
<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>Enqueue</title>
|
||
|
</head>
|
||
|
<body id="rzajqenqueue"><a name="rzajqenqueue"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Enqueue</h1>
|
||
|
<div><p>During a enqueue operation, an entry it put on the queue that contains
|
||
|
key values used by the recursive join predicates or data manipulated as a
|
||
|
part of the recursion process. The optimizer always supplies an enqueue operation
|
||
|
to collect the required recursive data on the query node directly above the
|
||
|
Union All. </p>
|
||
|
<div class="section">
|
||
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><caption>Table 1. Enqueue Attributes</caption><thead align="left"><tr><th valign="top" width="30.96446700507614%" id="d0e38">Data Access Method</th>
|
||
|
<th valign="top" width="69.03553299492386%" id="d0e40">Enqueue</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td valign="top" width="30.96446700507614%" headers="d0e38 "><strong>Description</strong></td>
|
||
|
<td valign="top" width="69.03553299492386%" headers="d0e40 ">Places an entry on the queue needed to cause further
|
||
|
recursion</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="30.96446700507614%" headers="d0e38 "><strong>Advantages</strong></td>
|
||
|
<td valign="top" width="69.03553299492386%" headers="d0e40 "><ul><li>Required as a source for the recursion. Only enqueues required values
|
||
|
for the recursion process. Each entry has short life span, until it is dequeued.</li>
|
||
|
<li>Each entry on the queue can seed multiple iterative fullselects that are
|
||
|
recursive from the same rcte/view.</li>
|
||
|
</ul>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="30.96446700507614%" headers="d0e38 "><strong>Likely to be used</strong></td>
|
||
|
<td valign="top" width="69.03553299492386%" headers="d0e40 ">A required access method for recursive queries </td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="30.96446700507614%" headers="d0e38 "><strong>Example SQL statement</strong></td>
|
||
|
<td valign="top" width="69.03553299492386%" headers="d0e40 "><pre>WITH RPL (PART, SUBPART, QUANTITY) AS
|
||
|
( SELECT ROOT.PART, ROOT.SUBPART, ROOT.QUANTITY
|
||
|
FROM PARTLIST ROOT
|
||
|
WHERE ROOT.PART = '01'
|
||
|
UNION ALL
|
||
|
SELECT CHILD.PART, CHILD.SUBPART, CHILD.QUANTITY
|
||
|
FROM RPL PARENT, PARTLIST CHILD
|
||
|
WHERE PARENT.SUBPART = CHILD.PART
|
||
|
)
|
||
|
SELECT DISTINCT PART, SUBPART, QUANTITY
|
||
|
FROM RPL</pre>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="30.96446700507614%" headers="d0e38 "><strong>Messages indicating use</strong></td>
|
||
|
<td valign="top" width="69.03553299492386%" headers="d0e40 ">There are no explicit message that indicate the use
|
||
|
of an enqueue</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="30.96446700507614%" headers="d0e38 "><strong>SMP parallel enabled</strong></td>
|
||
|
<td valign="top" width="69.03553299492386%" headers="d0e40 ">Yes</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="30.96446700507614%" headers="d0e38 "><strong>Also referred to as</strong></td>
|
||
|
<td valign="top" width="69.03553299492386%" headers="d0e40 ">Not applicable</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="30.96446700507614%" headers="d0e38 "><strong>Visual Explain icon</strong></td>
|
||
|
<td valign="top" width="69.03553299492386%" headers="d0e40 "><br /><img src="rzajq556.gif" alt="Enqueue icon" /><br /></td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="section"><p>Use the CYCLE option in the definition of the recursive query
|
||
|
if there is the possibility that the data reflecting the parent, child relationship
|
||
|
may be cyclic, causing an infinite recursion loop. CYCLE will
|
||
|
prevent already visited recursive key values from being put on the queue again
|
||
|
for a given set of related (ancestry chain) rows.</p>
|
||
|
<p>Use the SEARCH option
|
||
|
in the definition of the recursive query to return the results of the recursion
|
||
|
in the specified parent-child hierarchical ordering. The search choices are
|
||
|
Depth or Breadth first. Depth first means that all the descendents of each
|
||
|
immediate child are returned before the next child is returned. Breadth first
|
||
|
means that each child is returned before their children are returned. SEARCH
|
||
|
requires not only the specification of the relationship keys, which columns
|
||
|
make up the parent child relationship and the search type of Depth or Breadth
|
||
|
but it also requires an ORDER BY clause in the main query on the provided
|
||
|
sequence column in order to fully implement the specified ordering.</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzajqqueue.htm" title="The Queue is a temporary object that allows the optimizer to feed the recursion of a recursive query by putting on the queue those data values needed for the recursion. This data typically includes those values used on the recursive join predicate and other recursive data being accumulated or manipulated during the recursive process.">Queue</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|