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

65 lines
3.8 KiB
HTML
Raw 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="Summary of MQT query recommendations" />
<meta name="abstract" content="Follow these recommendations when using MQT queries." />
<meta name="description" content="Follow these recommendations when using MQT queries." />
<meta name="DC.Relation" scheme="URI" content="rzajqmqt.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="rzajqmqtsummary" />
<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>Summary of MQT query recommendations</title>
</head>
<body id="rzajqmqtsummary"><a name="rzajqmqtsummary"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Summary of MQT query recommendations</h1>
<div><p>Follow these recommendations when using MQT queries.</p>
<div class="section"> <ul><li>Do not include local selection or constants in the MQT because that limits
the number of user specified queries that query optimizer can use the MQT
in.</li>
<li>For grouping MQTs, only use the SUM, COUNT, MIN, and MAX grouping functions.
The query optimizer can recalculate AVG, STDDEV, and VAR_POP in user specified
queries.</li>
<li>Specifying FETCH FIRST N ROWS in the MQT limits the number of user specified
queries that the query optimizer can use the MQT in and is not recommended.</li>
<li>If the MQT is created with DATA INITIALLY DEFERRED, consider specifying
the DISABLE QUERY OPTIMIZATION clause to prevent the query optimizer from
using the MQT until it has been populated. When the MQT has been populated
and is ready for use, the ALTER TABLE statement with the ENABLE QUERY OPTIMIZATION
clause can used to enable the MQT for the query optimizer.</li>
</ul>
</div>
<div class="section"><p>MQT tables need to be optimized just like non-MQT tables. Indexes
should be created over the MQT columns that are used for selection, join and
grouping as appropriate. Column statistics are collected for MQT tables.</p>
</div>
<div class="section"><p>The database monitor shows the list of MQTs considered during
optimization. This information is in the 3030 record. If MQT usage has been
enabled through the QAQQINI file and a MQT exists over at least one of the
tables in the query, there will be a 3030 record for the query. Each MQT
has a reason code indicating that it was used or if it was not used, why it
was not used.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzajqmqt.htm" title="Materialized query tables (MQTs) (also referred to as automatic summary tables or materialized views) can provide performance enhancements for queries.">Materialized query table optimization</a></div>
</div>
</div>
</body>
</html>