Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / March 2006

Tip: Looking for answers? Try searching our database.

Optimizer not using MQT ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sa - 16 Mar 2006 04:03 GMT
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.
tuarek - 30 Mar 2006 16:07 GMT
SA,

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

Regards,

Mehmet
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.