80 lines
5.4 KiB
HTML
80 lines
5.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="concept" />
|
||
|
<meta name="DC.Title" content="Control how the system runs the Open Query File (OPNQRYF) command" />
|
||
|
<meta name="abstract" content="The optimization function allows you to specify how you are going to use the results of the query." />
|
||
|
<meta name="description" content="The optimization function allows you to specify how you are going to use the results of the query." />
|
||
|
<meta name="DC.subject" content="Open Query File (OPNQRYF) command, using, results of a query, OPNQRYF (Open Query File) command, results of a query, example, running the OPNQRYF command" />
|
||
|
<meta name="keywords" content="Open Query File (OPNQRYF) command, using, results of a query, OPNQRYF (Open Query File) command, results of a query, example, running the OPNQRYF command" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafodynrs.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafosropenex1.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafosropenex2.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="../rzajq/rzajqkickoff.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="rbafosropn" />
|
||
|
<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>Control how the system runs the Open Query File (OPNQRYF) command</title>
|
||
|
</head>
|
||
|
<body id="rbafosropn"><a name="rbafosropn"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Control how the system runs the Open Query File (OPNQRYF) command</h1>
|
||
|
<div><p>The optimization function allows you to specify how you are going
|
||
|
to use the results of the query.</p>
|
||
|
<p>When you use the Open Query File (OPNQRYF) command, there are two steps
|
||
|
where performance considerations exist. The first step is during the actual
|
||
|
processing of the OPNQRYF command itself. This step decides if the OPNQRYF
|
||
|
command is going to use an existing access path or build a new one for this
|
||
|
query request. The second step when performance considerations play a role
|
||
|
is when the application program is using the results of the OPNQRYF command
|
||
|
to process the data.</p>
|
||
|
<p>For most batch type functions, you are usually only interested in the total
|
||
|
time of both steps mentioned in the preceding paragraph. Therefore, the default
|
||
|
for the OPNQRYF command is OPTIMIZE(*ALLIO). This means that the OPNQRYF command
|
||
|
considers the total time it takes for both steps.</p>
|
||
|
<p>If you use the OPNQRYF command in an interactive environment, you might
|
||
|
not be interested in processing the entire file. You might want the first
|
||
|
screen full of records to be displayed as quickly as possible. For this reason,
|
||
|
you want the first step to avoid building an access path, if possible. You
|
||
|
can specify OPTIMIZE(*FIRSTIO) in such a situation.</p>
|
||
|
<p>If you want to process the same results of the OPNQRYF command with multiple
|
||
|
programs, you might want the first step to make an efficient open data path
|
||
|
(ODP). That is, you try to minimize the number of records that must be read
|
||
|
by the processing program in the second step by specifying OPTIMIZE(*MINWAIT)
|
||
|
on the OPNQRYF command.</p>
|
||
|
<p>If the KEYFLD or GRPFLD parameter on the OPNQRYF command requires that
|
||
|
an access path be built when there is no access path to share, the access
|
||
|
path is built entirely regardless of the OPTIMIZE entry. Optimization mainly
|
||
|
affects selection processing.</p>
|
||
|
</div>
|
||
|
<div>
|
||
|
<ul class="ullinks">
|
||
|
<li class="ulchildlink"><strong><a href="rbafosropenex1.htm">Example 1: Control how the system runs the Open Query File (OPNQRYF) command</a></strong><br />
|
||
|
This example shows how to optimize for the first set of records.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rbafosropenex2.htm">Example 2: Control how the system runs the Open Query File command</a></strong><br />
|
||
|
This example shows how to optimize to minimize the number of records read.</li>
|
||
|
</ul>
|
||
|
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafodynrs.htm" title="Dynamic record selection allows you to request a subset of the records in a file without using data description specifications (DDS).">Select records without using DDS</a></div>
|
||
|
</div>
|
||
|
<div class="relconcepts"><strong>Related concepts</strong><br />
|
||
|
<div><a href="../rzajq/rzajqkickoff.htm">Database performance and query optimization</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|