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

91 lines
5.7 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="Using the Query Governor" />
<meta name="abstract" content="The resource governor works in conjunction with the query optimizer." />
<meta name="description" content="The resource governor works in conjunction with the query optimizer." />
<meta name="DC.subject" content="governor, JOB, time limit, limit, time, query time limit" />
<meta name="keywords" content="governor, JOB, time limit, limit, time, query time limit" />
<meta name="DC.Relation" scheme="URI" content="govrle.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="howqrygovworks" />
<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>Using the Query Governor</title>
</head>
<body id="howqrygovworks"><a name="howqrygovworks"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Using the Query Governor</h1>
<div><p>The resource governor works in conjunction with the query optimizer.</p>
<div class="section"><p>When a user issues a request to the server to run a query, the
following occurs: </p>
</div>
<div class="section"> <ol><li>The query access plan is created by the optimizer. <p>As part of the
evaluation, the optimizer predicts or estimates the runtime for the query.
This helps determine the best way to access and retrieve the data for the
query. In addition, as part of the estimating process, the optimizer also
computes the estimated temporary storage usage for the query.</p>
</li>
<li>The estimated runtime and estimated temporary storage is compared against
the user-defined query limit currently in effect for the job or user session.</li>
<li>If the estimates for the query are less than or equal to the specified
limits, the query governor lets the query run without interruption and no
message is sent to the user.</li>
<li>If the query limit is exceeded, inquiry message CPA4259 is sent to the
user. The message states the estimates as well as the specified limits. Realize
that only one limit needs to be exceeded; it is possible that you will see
that only one limit was exceeded. Also, if no limit was explicitly specified
by the user, a large integer value will be shown for that limit. <div class="note"><span class="notetitle">Note:</span> A
default reply can be established for this message so that the user does not
have the option to reply to the message, and the query request is <em>always</em> ended.</div>
</li>
<li>If a default message reply is not used, the user chooses to do one of
the following: <ul><li>End the query request before it is actually run.</li>
<li>Continue and run the query even though the estimated value exceeds the
associated governor limit.</li>
</ul>
</li>
</ol>
</div>
<div class="section"><p><strong>Setting the resource limits for jobs other than the current
job</strong></p>
<p>You can set either or both resource limits for a job other than
the current job. You do this by using the JOB parameter on the <span class="cmdname">Change
Query Attributes (CHGQRYA)</span> command to specify either a query options
file library to search (QRYOPTLIB) or a specific QRYTIMLMT, or QRYSTGLMT,
or both for that job.</p>
</div>
<div class="section"><p><strong>Using the resource limits to balance system resources</strong></p>
<p>After
the source job runs the <span class="cmdname">Change Query Attributes (CHGQRYA)</span> command,
effects of the governor on the target job is not dependent upon the source
job. The query resource limits remain in effect for the duration of the job
or user session, or until a resource limit is changed by a <span class="cmdname">Change
Query Attributes (CHGQRYA)</span> command. Under program control, a user
might be given different limits depending on the application function being
performed, the time of day, or the amount of system resources available. This
provides a significant amount of flexibility when trying to balance system
resources with temporary query requirements.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="govrle.htm" title="The DB2 Universal Database for iSeries Predictive Query Governor can stop the initiation of a query if the estimated run time (elapsed execution time) or estimated temporary storage for the query is excessive. The governor acts before a query is run instead of while a query is run. The governor can be used in any interactive or batch job on the iSeries. It can be used with all DB2 Universal Database for iSeries query interfaces and is not limited to use with SQL queries.">Set resource limits with the Predictive Query Governor</a></div>
</div>
</div>
</body>
</html>