Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
MQT table use by optimizer
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Kevin  
View profile  
 More options Dec 8 2006, 7:12 pm
Newsgroups: comp.databases.ibm-db2
From: "Kevin" <kfw...@hotmail.com>
Date: 8 Dec 2006 16:12:43 -0800
Local: Fri, Dec 8 2006 7:12 pm
Subject: MQT table use by optimizer

Using a base table, a MQT table was created.  With optimization - when
querying the base table with calcuation that are already completed in
the MQT - I would assume the optimizer would use the MQT table instead
of the base table.

What causes the optimizer to use the MQT tables rather than the tables
as defined by the query?  Is there a way to "encourage" use of the MQT
tables?

Thanks.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Shashi Mannepalli  
View profile  
 More options Dec 10 2006, 12:54 am
Newsgroups: comp.databases.ibm-db2
From: "Shashi Mannepalli" <shashit...@yahoo.com>
Date: 9 Dec 2006 21:54:43 -0800
Local: Sun, Dec 10 2006 12:54 am
Subject: Re: MQT table use by optimizer
Check for this in the documentation

SET CURRENT REFRESH AGE= ANY

cheers..
Shashi Mannepalli


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kevin  
View profile  
 More options Dec 11 2006, 8:44 am
Newsgroups: comp.databases.ibm-db2
From: "Kevin" <kfw...@hotmail.com>
Date: 11 Dec 2006 05:44:01 -0800
Local: Mon, Dec 11 2006 8:44 am
Subject: Re: MQT table use by optimizer

Shashi,

I am using explain to verify that the mqt table is being used.  Should
set current refresh age be included prior to executing my sql
statement?

Thanks.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Shashi Mannepalli  
View profile  
 More options Dec 11 2006, 11:10 am
Newsgroups: comp.databases.ibm-db2
From: "Shashi Mannepalli" <shashit...@yahoo.com>
Date: 11 Dec 2006 08:10:15 -0800
Local: Mon, Dec 11 2006 11:10 am
Subject: Re: MQT table use by optimizer
Yes

SET CURRENT REFRESH AGE=ANY

  SELECT YEAR(pdate) AS year, SUM(ti.amount) AS amount
  FROM   cube.transitem AS ti, cube.trans AS t,
         cube.loc AS loc, cube.pgroup AS pg,
         cube.prodline AS l
  WHERE  ti.transid = t.id
     AND ti.pgid = pg.id
     AND pg.lineid = l.id
     AND t.locid = loc.id
     AND YEAR(pdate) IN (1995, 1996)
  GROUP BY year(pdate);

An example i saw in this

http://publib.boulder.ibm.com/infocenter/db2luw/v8//index.jsp

There are some restrictions/instructions also available in the above
link.
Search for CURRENT REFRESH AGE in that link

cheers..
Shashi Mannepalli


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
fbo...@fastmail.fm  
View profile  
 More options Dec 13 2006, 9:59 am
Newsgroups: comp.databases.ibm-db2
From: fbo...@fastmail.fm
Date: 13 Dec 2006 06:59:52 -0800
Local: Wed, Dec 13 2006 9:59 am
Subject: Re: MQT table use by optimizer
Shashi,

if you created a "refresh immediate" MQT it will be used in any case
when the query benefits from the MQT.

if you created the MQT with "refresh deferred" it depends whether the
MQT is maintained by system or maintained by user.

maintained by system (default):
use set current refresh age = any

there is another register:
set current maintained table types for optimization (default = SYSTEM)

maintained by user:
set current maintained table types for optimization [USER|ALL]

You can set that register or set the DB CONFIG PARAM:
DB2 UPDATE DATABASE CONFUGURATION FOR [DBNAME] USING DFT_MTTB_TYPES
[USER|SYSTEM|ALL]

Not sure if this still applies to Version 8.2 but if you already run a
SQL statement prior to the creation of the MQT the SQL might still
reside in the dynamic statement cache and if you created the MQT it
might not be considered by the optimizer because of the existing plan
in the cache. So to be sure from command line issue a:

FLUSH PACKAGE CACHE--DYNAMIC
in order to have the optimizer creating a fresh access path

This articel covers a lot of the MQT world:
http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0605...

Last but not least: In Version UDB 7 the visual explain was not able to
show the usage of an MQT allthough it was used. Step 10 of the
developer works articel covers the access paths of MQT usage.

I hope that helps
Cheers
Florian

-------------------------
Speedgain for DB2 LUW - Performance Monitoring for DB2 UDB LUW

Kevin schrieb:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian  
View profile  
 More options Dec 13 2006, 5:08 pm
Newsgroups: comp.databases.ibm-db2
From: Ian <ianb...@mobileaudio.com>
Date: Wed, 13 Dec 2006 15:08:43 -0700
Local: Wed, Dec 13 2006 5:08 pm
Subject: Re: MQT table use by optimizer

Kevin wrote:
> Shashi,

> I am using explain to verify that the mqt table is being used.  Should
> set current refresh age be included prior to executing my sql
> statement?

You can also set the DFT_REFRESH_AGE database configuration parameter
in the event that you can't force all clients to issue the SET CURRENT
REFRESH AGE register.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »