104 lines
8.7 KiB
HTML
104 lines
8.7 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="Collecting statistics with the Statistics Manager" />
|
||
|
<meta name="abstract" content="As stated earlier, the collection of statistics is handled by a separate component called the Statistics Manager. Statistical information can be used by the query optimizer to determine the best access plan for a query. Since the query optimizer bases its choice of access plan on the statistical information found in the table, it is important that this information be current." />
|
||
|
<meta name="description" content="As stated earlier, the collection of statistics is handled by a separate component called the Statistics Manager. Statistical information can be used by the query optimizer to determine the best access plan for a query. Since the query optimizer bases its choice of access plan on the statistical information found in the table, it is important that this information be current." />
|
||
|
<meta name="DC.subject" content="statistics manager, definitions, statistics manager" />
|
||
|
<meta name="keywords" content="statistics manager, definitions, statistics manager" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="queryopt.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="autostats.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="autostatsrefresh.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzajqstatsrequest.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="statsvindex.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="monitorstats.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="replicatestats.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="statexist.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="statsmanually.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="statsapis.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzajqstatsmgr.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="statsmanager" />
|
||
|
<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>Collecting statistics with the Statistics Manager</title>
|
||
|
</head>
|
||
|
<body id="statsmanager"><a name="statsmanager"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Collecting statistics with the Statistics Manager</h1>
|
||
|
<div><p>As stated earlier, the collection of statistics is handled by a
|
||
|
separate component called the Statistics Manager. Statistical information
|
||
|
can be used by the query optimizer to determine the best access plan for a
|
||
|
query. Since the query optimizer bases its choice of access plan on the statistical
|
||
|
information found in the table, it is important that this information be current.</p>
|
||
|
<div class="section"><p>On many platforms, statistics collection is a manual process that
|
||
|
is the responsibility of the database administrator. With iSeries™ servers,
|
||
|
the database statistics collection process is handled automatically, and only
|
||
|
rarely is it necessary to update statistics manually.</p>
|
||
|
</div>
|
||
|
<div class="section"><p>The Statistics Manager does not actually run or optimize the query.
|
||
|
It controls the access to the metadata and other information that is required
|
||
|
to optimize the query. It uses this information to answer questions posed
|
||
|
by the query optimizer. The answers can either be derived from table header
|
||
|
information, from existing indexes, or from single-column statistics. </p>
|
||
|
</div>
|
||
|
<div class="section"><p>The Statistics Manager must always provide an answer
|
||
|
to the questions from the Optimizer. It uses the best method available to
|
||
|
provide the answers. For example, it may use a single-column statistic or
|
||
|
perform a key range estimate over an index. Along with the answer, the Statistics
|
||
|
Manager returns a confidence level to the optimizer that the optimizer may
|
||
|
use to provide greater latitude for sizing algorithms. If the Statistics Manager
|
||
|
provides a low confidence in the number of groups that are estimated for a
|
||
|
grouping request, then the optimizer may increase the size of the temporary
|
||
|
hash table allocated.</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<ul class="ullinks">
|
||
|
<li class="ulchildlink"><strong><a href="autostats.htm">Automatic statistics collection</a></strong><br />
|
||
|
When the Statistics Manager prepares its responses to the Optimizer, it keeps track of the responses that are generated by using default filter factors (because column statistics or indexes were not available). It uses this information during the time that the access plan is being written to the Plan Cache to automatically generate a statistic collection request for the columns. If system resources allow it, the Statistics Manager generates statistics collections in real time for direct use by the current query, avoiding a default answer to the Optimizer.</li>
|
||
|
<li class="ulchildlink"><strong><a href="autostatsrefresh.htm">Automatic statistics refresh</a></strong><br />
|
||
|
Column statistics are not maintained when the underlying table data changes. The Statistics Manager determines if columns statistics are still valid or if they no longer represent the column accurately (stale).</li>
|
||
|
<li class="ulchildlink"><strong><a href="rzajqstatsrequest.htm">Viewing statistics requests</a></strong><br />
|
||
|
You can view the current statistics requests by using iSeries Navigator
|
||
|
or by using Statistics APIs.</li>
|
||
|
<li class="ulchildlink"><strong><a href="statsvindex.htm">Indexes versus column statistics</a></strong><br />
|
||
|
If you are trying to decide whether to use statistics or indexes to provide information to the Statistics Manager, keep the following differences in mind.</li>
|
||
|
<li class="ulchildlink"><strong><a href="monitorstats.htm">Monitoring background statistics collection</a></strong><br />
|
||
|
The system value QDBFSTCCOL controls who is allowed to create statistics in the background.</li>
|
||
|
<li class="ulchildlink"><strong><a href="replicatestats.htm">Replication of column statistics with CRTDUPOBJ versus CPYF</a></strong><br />
|
||
|
You can replicate column statistics with the <span class="cmdname">Create Duplicate
|
||
|
Object (CRTDUPOBJ)</span> or the <span class="cmdname">Copy File (CPYF)</span> commands.</li>
|
||
|
<li class="ulchildlink"><strong><a href="statexist.htm">Determining what column statistics exist</a></strong><br />
|
||
|
You can determine what column statistics exist in a couple of ways.</li>
|
||
|
<li class="ulchildlink"><strong><a href="statsmanually.htm">Manually collecting and refreshing statistics</a></strong><br />
|
||
|
You can manually collect and refresh statistics through iSeries Navigator
|
||
|
or by using Statistics APIs.</li>
|
||
|
<li class="ulchildlink"><strong><a href="statsapis.htm">Statistics Manager APIs</a></strong><br />
|
||
|
The following APIs are used to implement the statistics function
|
||
|
of <span class="keyword">iSeries Navigator</span>. </li>
|
||
|
</ul>
|
||
|
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="queryopt.htm" title="Query optimization is an iterative process. You can gather performance information about your queries and control the processing of your queries.">Optimizing query performance using query optimization tools</a></div>
|
||
|
</div>
|
||
|
<div class="relconcepts"><strong>Related concepts</strong><br />
|
||
|
<div><a href="rzajqstatsmgr.htm" title="In releases before V5R2, the retrieval of statistics was a function of the Optimizer. When the Optimizer needed to know information about a table, it looked at the table description to retrieve the row count and table size. If an index was available, the Optimizer might then extract further information about the data in the table. In V5R2, the collection of statistics was removed from the Optimizer and is now handled by a separate component called the Statistics Manager.">Statistics Manager</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|