144 lines
10 KiB
HTML
144 lines
10 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="Database monitor performance analysis example 2" />
|
|
<meta name="abstract" content="Similar to the preceding example that showed which SQL applications were implemented with table scans, the following example shows all queries that are implemented with table scans." />
|
|
<meta name="description" content="Similar to the preceding example that showed which SQL applications were implemented with table scans, the following example shows all queries that are implemented with table scans." />
|
|
<meta name="DC.subject" content="performance analysis, example 2, examples, output, all queries that performed table scans, table scans, output for all queries" />
|
|
<meta name="keywords" content="performance analysis, example 2, examples, output, all queries that performed table scans, table scans, output for all queries" />
|
|
<meta name="DC.Relation" scheme="URI" content="dbmonexamples.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="rzajqmon2" />
|
|
<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>Database monitor performance analysis example 2</title>
|
|
</head>
|
|
<body id="rzajqmon2"><a name="rzajqmon2"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Database monitor performance analysis example 2</h1>
|
|
<div><p>Similar to the preceding example that showed which SQL applications
|
|
were implemented with table scans, the following example shows all queries
|
|
that are implemented with table scans.</p>
|
|
<div class="section"><pre><strong>SELECT</strong> A.System_Table_Schema, A.System_Table_Name,
|
|
A.Table_Total_Rows, A.Index_Advised,
|
|
B.Open_Id, B.Open_Time,
|
|
C.Clock_Time_to_Return_All_Rows, C.Number_Rows_Returned, D.Result_Rows,
|
|
(D.End_Timestamp - D.Start_Timestamp) <strong>AS</strong> TOT_TIME,
|
|
D.Statement_Text_Long
|
|
<strong>FROM</strong> LIB/QQQ3000 A <strong>INNER JOIN</strong> LIB/QQQ3014 B
|
|
<strong>ON</strong> (A.Join_Column = B.Join_Column AND
|
|
A.Unique_Count = B.Unique_Count)
|
|
<strong>LEFT OUTER JOIN</strong> LIB/QQQ3019 C
|
|
<strong>ON</strong> (A.Join_Column = C.Join_Column AND A.Unique_Count = C.Unique_Count)
|
|
<strong>LEFT OUTER JOIN</strong> LIB/QQQ1000 D
|
|
<strong>ON</strong> (A.Join_Column = D.Join_Column AND A.Unique_Count = D.Unique_Count)</pre>
|
|
</div>
|
|
<div class="section"><div class="p">In this example, the output for all queries that performed table
|
|
scans are shown in the table below. <div class="note"><span class="notetitle">Note:</span> The columns selected from table
|
|
QQQ1000 do return NULL default values if the query was not executed
|
|
using SQL. For this example assume the default value for character data is
|
|
blanks and the default value for numeric data is an asterisk (*).</div>
|
|
</div>
|
|
</div>
|
|
|
|
<table cellpadding="4" cellspacing="0" border="1" class="tableborder"><tr><td>
|
|
<a name="rzajqmon2__altbsc"><!-- --></a><table cellpadding="4" cellspacing="0" summary="" id="rzajqmon2__altbsc" width="100%" border="0"><caption>Table 1. Output
|
|
for All Queries that Performed Table Scans</caption><thead align="left"><tr><th align="left" valign="bottom" width="7.2106261859582546%" id="d0e80">Lib Name</th>
|
|
<th align="left" valign="bottom" width="7.400379506641366%" id="d0e82">Table Name</th>
|
|
<th align="left" valign="bottom" width="7.400379506641366%" id="d0e84">Total Rows</th>
|
|
<th align="left" valign="bottom" width="9.867172675521822%" id="d0e86">Index Advised</th>
|
|
<th align="left" valign="bottom" width="7.7798861480075905%" id="d0e88">Query OPNID</th>
|
|
<th align="left" valign="bottom" width="7.7798861480075905%" id="d0e90">ODP Open Time</th>
|
|
<th align="left" valign="bottom" width="7.400379506641366%" id="d0e92">Clock Time</th>
|
|
<th align="left" valign="bottom" width="7.7798861480075905%" id="d0e94">Recs Rtned</th>
|
|
<th align="left" valign="bottom" width="7.7798861480075905%" id="d0e96">Rows Rtned</th>
|
|
<th align="left" valign="bottom" width="7.400379506641366%" id="d0e98">TOT_ TIME</th>
|
|
<th align="left" valign="bottom" width="22.2011385199241%" id="d0e100">Statement Text</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr><td align="left" valign="top" width="7.2106261859582546%" headers="d0e80 "><strong>LIB1</strong></td>
|
|
<td align="left" valign="top" width="7.400379506641366%" headers="d0e82 "><strong>TBL1</strong></td>
|
|
<td align="left" valign="top" width="7.400379506641366%" headers="d0e84 "><strong>20000</strong></td>
|
|
<td align="left" valign="top" width="9.867172675521822%" headers="d0e86 "><strong>Y</strong></td>
|
|
<td align="left" valign="top" width="7.7798861480075905%" headers="d0e88 "><strong></strong></td>
|
|
<td align="left" valign="top" width="7.7798861480075905%" headers="d0e90 "><strong>1.1</strong></td>
|
|
<td align="left" valign="top" width="7.400379506641366%" headers="d0e92 "><strong>4.7</strong></td>
|
|
<td align="left" valign="top" width="7.7798861480075905%" headers="d0e94 "><strong>10</strong></td>
|
|
<td align="left" valign="top" width="7.7798861480075905%" headers="d0e96 "><strong>10</strong></td>
|
|
<td align="left" valign="top" width="7.400379506641366%" headers="d0e98 "><strong>6.2</strong></td>
|
|
<td align="left" valign="top" width="22.2011385199241%" headers="d0e100 "><pre>SELECT *
|
|
FROM LIB1/TBL1
|
|
WHERE FLD1 = 'A'</pre>
|
|
</td>
|
|
</tr>
|
|
<tr><td align="left" valign="top" width="7.2106261859582546%" headers="d0e80 "><strong>LIB1</strong></td>
|
|
<td align="left" valign="top" width="7.400379506641366%" headers="d0e82 "><strong>TBL2</strong></td>
|
|
<td align="left" valign="top" width="7.400379506641366%" headers="d0e84 "><strong>100</strong></td>
|
|
<td align="left" valign="top" width="9.867172675521822%" headers="d0e86 "><strong>N</strong></td>
|
|
<td align="left" valign="top" width="7.7798861480075905%" headers="d0e88 "><strong></strong></td>
|
|
<td align="left" valign="top" width="7.7798861480075905%" headers="d0e90 "><strong>0.1</strong></td>
|
|
<td align="left" valign="top" width="7.400379506641366%" headers="d0e92 "><strong>0.7</strong></td>
|
|
<td align="left" valign="top" width="7.7798861480075905%" headers="d0e94 "><strong>100</strong></td>
|
|
<td align="left" valign="top" width="7.7798861480075905%" headers="d0e96 "><strong>100</strong></td>
|
|
<td align="left" valign="top" width="7.400379506641366%" headers="d0e98 "><strong>0.9</strong></td>
|
|
<td align="left" valign="top" width="22.2011385199241%" headers="d0e100 "><pre>SELECT *
|
|
FROM LIB1/TBL2</pre>
|
|
</td>
|
|
</tr>
|
|
<tr><td align="left" valign="top" width="7.2106261859582546%" headers="d0e80 "><strong>LIB1</strong></td>
|
|
<td align="left" valign="top" width="7.400379506641366%" headers="d0e82 "><strong>TBL1</strong></td>
|
|
<td align="left" valign="top" width="7.400379506641366%" headers="d0e84 "><strong>20000</strong></td>
|
|
<td align="left" valign="top" width="9.867172675521822%" headers="d0e86 "><strong>Y</strong></td>
|
|
<td align="left" valign="top" width="7.7798861480075905%" headers="d0e88 "><strong></strong></td>
|
|
<td align="left" valign="top" width="7.7798861480075905%" headers="d0e90 "><strong>2.6</strong></td>
|
|
<td align="left" valign="top" width="7.400379506641366%" headers="d0e92 "><strong>4.4</strong></td>
|
|
<td align="left" valign="top" width="7.7798861480075905%" headers="d0e94 "><strong>32</strong></td>
|
|
<td align="left" valign="top" width="7.7798861480075905%" headers="d0e96 "><strong>32</strong></td>
|
|
<td align="left" valign="top" width="7.400379506641366%" headers="d0e98 "><strong>7.1</strong></td>
|
|
<td align="left" valign="top" width="22.2011385199241%" headers="d0e100 "><pre>SELECT *
|
|
FROM LIB1/TBL1
|
|
WHERE FLD1 = 'A'
|
|
AND FLD2 > 9000</pre>
|
|
</td>
|
|
</tr>
|
|
<tr><td align="left" valign="top" width="7.2106261859582546%" headers="d0e80 "><strong>LIB1</strong></td>
|
|
<td align="left" valign="top" width="7.400379506641366%" headers="d0e82 "><strong>TBL4</strong></td>
|
|
<td align="left" valign="top" width="7.400379506641366%" headers="d0e84 "><strong>4000</strong></td>
|
|
<td align="left" valign="top" width="9.867172675521822%" headers="d0e86 "><strong>N</strong></td>
|
|
<td align="left" valign="top" width="7.7798861480075905%" headers="d0e88 "><strong>QRY04</strong></td>
|
|
<td align="left" valign="top" width="7.7798861480075905%" headers="d0e90 "><strong>1.2</strong></td>
|
|
<td align="left" valign="top" width="7.400379506641366%" headers="d0e92 "><strong>4.2</strong></td>
|
|
<td align="left" valign="top" width="7.7798861480075905%" headers="d0e94 "><strong>724</strong></td>
|
|
<td align="left" valign="top" width="7.7798861480075905%" headers="d0e96 "><strong>*</strong></td>
|
|
<td align="left" valign="top" width="7.400379506641366%" headers="d0e98 "><strong>*</strong></td>
|
|
<td align="left" valign="top" width="22.2011385199241%" headers="d0e100 "><strong>*</strong></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</td></tr></table>
|
|
<div class="section"><p>If the SQL statement text is not needed, joining to table QQQ1000
|
|
is not necessary. You can determine the total time and rows selected from
|
|
data in the QQQ3014 and QQQ3019 rows.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dbmonexamples.htm" title="The iSeries navigator interface provides a powerful tool for gathering and analyzing performance monitor data using database monitor. However, you may want to do your own analysis of the database monitor files.">Database monitor examples</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |