Hi,

I have Few question on MQT.

I have created an MQT,

create table db2dba.mqt_daily_trx as
( select rep_id,org_id, sum(sale_amt),sum(invt_amt)
from db2dba.daily_trx
group by rep_id, org_id
)
DATA INITIALLY DEFERRED refresh DEFERRED maintained by system


after setting the parameter,

set current refresh age any
SET CURRENT QUERY OPTIMIZATION 5
Set CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION ALL

Also ran the RUNSTATS on the Table..

I issued the query,
select rep_id,sum(sale_amt) from db2dba.daily_trx where rep_id=1
group by rep_id


This query is not hitting the MQT..

But when i issue the query,
select rep_id,sum(sale_amt) from db2dba.daily_trx
group by rep_id

It is hitting the MQT..

There is index on both rep_id and org_id

Can any one help on this? why is it so?


Thanks in advance,
Sathish