473,503 Members | 1,656 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Optimizer not using MQT ?

Sa
DB2 V 8.1.6 and DB2 V8.2.4

I'm using a Fact Table and 7 Dimension tables in a MQT definition.

create mqt1(col-list) as
(
select dim1_desc,
dim2_desc,
....
dim6_date,
dim7_desc,
sum(amount),
count(amount),
grouping(dim1_desc),
grouping(dim2_desc),
...
grouping(dim7_desc)
from fact , dim1,dim2,dim3....dim7
where <join condition - matching the dimension keys between fact and
dimension table>
and dim6.date between '2001-01-01' and '2001-01-31'
) data initially deferred refresh deferred enable query optimization ..
When I execute queries, for example,

select dim1_desc,dim6_date,sum(amount) from dim1,dim6,fact where <join
conditions> and dim6.date='2001-01-15'

or

select dim1_desc,dim6_date,sum(amount) from dim1,dim6,fact where <join
conditions> and dim6.date between '2001-01-01' and '2001-01-30'

they do not use the MQT (CURRENT REFRESH AGE is set to ANY)
But the same queries use the MQT if the MQT defintion excludes the
clause "and dim6.date between '2001-01-01' and '2001-01-31' " ...

Is this a known limitation of query rewrite using MQT or am I missing
something ?

Thanks in advance.

Mar 16 '06 #1
1 1719
SA,

Did you try putting dim6.date into "group by" clause in the MQT
definition?

Regards,

Mehmet

Mar 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2388
by: Nick Mudge | last post by:
Hi, Does anybody know the performance difference between having your PHP code cached and just running your code with the zend optimizer? Is there much difference? Nick
9
4729
by: hemal | last post by:
I came across a very strange situation at work. There is an order of magnitude difference in execution time for the following two queries (10 v/s ~130 msec): select count(*) from table_name...
0
3079
by: Ed | last post by:
------=_NextPart_000_001D_01C34FCC.1D2B5E50 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable There seems to be a significant penalty imposed by the...
14
1945
by: Bupp Phillips | last post by:
I have a customer table that has the field CUSTOMER_ID as the primary key (cust_pkkey), the table has 102,834 records in it. The following select statement works fine: select * from customer...
3
2073
by: Peter Arrenbrecht | last post by:
Hi all We ran into a very annoying optimizer problem recently. We had added a new key and self-join relation to a large production table. That key will be filled very rarely and having just...
9
2788
by: Andrea | last post by:
Hi, I've read the former postings but was not able to solve my problem: I have a Summary Table (or MQT as you like it) and the query optimizer does not seem to use the summary table. I run...
2
1280
by: Brian Ross | last post by:
Hi, Would it be fair to say the following is an optimizer bug? --- Test.cpp --- #include <cstdio> using std::printf;
5
3036
by: Kevin | last post by:
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...
2
3895
by: boa sema | last post by:
Way back when, and at least in version 7 IIRC, the query optimizer gave up when the where clause in a statement contained more than 4 search conditions. Does anyone know if such a limitation...
3
2358
by: aj | last post by:
DB2 LUW v8.2 FP 14 RHAS 2.1 Sorry if these are newbie questions. Optimizer stuff is black magic to me. For both of these, assume stats are current and an even distribution of data....
0
7072
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7319
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6979
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5570
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.