98 lines
6.5 KiB
HTML
98 lines
6.5 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="Control database manager blocking" />
|
||
|
<meta name="abstract" content="To improve performance, the SQL runtime attempts to retrieve and insert rows from the database manager a block at a time whenever possible." />
|
||
|
<meta name="description" content="To improve performance, the SQL runtime attempts to retrieve and insert rows from the database manager a block at a time whenever possible." />
|
||
|
<meta name="DC.subject" content="improving performance, blocking, using, performance improvement, blocking consideration, using, affect on performance, command (CL), Override Database File (OVRDBF), OVRDBF (Override Database File)" />
|
||
|
<meta name="keywords" content="improving performance, blocking, using, performance improvement, blocking consideration, using, affect on performance, command (CL), Override Database File (OVRDBF), OVRDBF (Override Database File)" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="progtech.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="../cl/ovrdbf.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="precompileopts.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="ipbc" />
|
||
|
<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 database manager blocking</title>
|
||
|
</head>
|
||
|
<body id="ipbc"><a name="ipbc"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Control database manager blocking</h1>
|
||
|
<div><p>To improve performance, the SQL runtime attempts to retrieve and
|
||
|
insert rows from the database manager a block at a time whenever possible.</p>
|
||
|
<div class="section"><p>You can control blocking, if you want. Use the SEQONLY parameter
|
||
|
on the CL command <span class="cmdname">Override Database File (OVRDBF)</span> before
|
||
|
calling the application program that contains the SQL statements. You can
|
||
|
also specify the ALWBLK parameter on the CRTSQLxxx commands.</p>
|
||
|
</div>
|
||
|
<div class="section"><p>The database manager does not allow blocking in the following
|
||
|
situations: </p>
|
||
|
<ul><li>The cursor is update or delete capable.</li>
|
||
|
<li>The length of the row plus the feedback information is greater than 32767.
|
||
|
The minimum size for the feedback information is 11 bytes. The feedback size
|
||
|
is increased by the number of bytes in the key columns for the index used
|
||
|
by the cursor and by the number of key columns, if any, that are null capable.</li>
|
||
|
<li>COMMIT(*CS) is specified, and ALWBLK(*ALLREAD) is not specified.</li>
|
||
|
<li>COMMIT(*ALL) is specified, and the following are true: <ul><li>A SELECT INTO statement or a blocked FETCH statement is not used</li>
|
||
|
<li>The query does not use column functions or specify group by columns.</li>
|
||
|
<li>A temporary result table does not need to be created.</li>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>COMMIT(*CHG) is specified, and ALWBLK(*ALLREAD) is not specified.</li>
|
||
|
<li>The cursor contains at least one subquery and the outermost subselect
|
||
|
provided a correlated reference for a subquery or the outermost subselect
|
||
|
processed a subquery with an IN, = ANY, or < > ALL subquery predicate
|
||
|
operator, which is treated as a correlated reference, and that subquery is
|
||
|
not isolatable.</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="section"><p>The SQL run-time automatically blocks rows with the database manager
|
||
|
in the following cases: </p>
|
||
|
<ul><li>INSERT <div class="p">If an INSERT statement contains a select-statement, inserted
|
||
|
rows are blocked and not actually inserted into the target table until the
|
||
|
block is full. The SQL run-time automatically does blocking for blocked inserts. <div class="note"><span class="notetitle">Note:</span> If
|
||
|
an INSERT with a VALUES clause is specified, the SQL run-time might not actually
|
||
|
close the internal cursor that is used to perform the inserts until the program
|
||
|
ends. If the same INSERT statement is run again, a full open is not necessary
|
||
|
and the application runs much faster.</div>
|
||
|
</div>
|
||
|
</li>
|
||
|
<li>OPEN <div class="p">Blocking is done under the OPEN statement when the rows are retrieved
|
||
|
if all of the following conditions are true: <ul><li>The cursor is only used for FETCH statements.</li>
|
||
|
<li>No EXECUTE or EXECUTE IMMEDIATE statements are in the program, or ALWBLK(*ALLREAD)
|
||
|
was specified, or the cursor is declared with the FOR FETCH ONLY clause.</li>
|
||
|
<li>COMMIT(*CHG) and ALWBLK(*ALLREAD) are specified, COMMIT(*CS) and ALWBLK(*ALLREAD)
|
||
|
are specified, or COMMIT(*NONE) is specified.</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="progtech.htm" title="By changing the coding of your queries, you can improve their performance.">Programming techniques for database performance</a></div>
|
||
|
</div>
|
||
|
<div class="relref"><strong>Related reference</strong><br />
|
||
|
<div><a href="precompileopts.htm" title="Several precompile options are available for creating SQL programs with improved performance. They are only options because using them may impact the function of the application. For this reason, the default value for these parameters is the value that will ensure successful migration of applications from prior releases. However, you can improve performance by specifying other options.">Effects of precompile options on database performance</a></div>
|
||
|
</div>
|
||
|
<div class="relinfo"><strong>Related information</strong><br />
|
||
|
<div><a href="../cl/ovrdbf.htm">Override Database File (OVRDBF) command</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|