If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Mqt

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-23-08, 05:35
sathish_ix sathish_ix is offline
Registered User
 
Join Date: Apr 2008
Posts: 4
Mqt

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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On