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 > Any option to make the stagging table refresh to be deferred?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-04-08, 07:12
aveerabadran aveerabadran is offline
Registered User
 
Join Date: Mar 2008
Posts: 11
Any option to make the stagging table refresh to be deferred?

Hi,

i am using MQTs to improve the performance of the summary level queries.

for refreshing the MQT, i am using stagging table concept. i give the following sql to create the stagging table -

create table MAT_STG_TAB for MAT_TAB propagate immediate

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& full code
create table MAT_TAB as (select COL1,COL2, COL3, count(*) as count
from BAS_TAB group by COL1,COL2, COL3)
data initially deferred refresh deferred

create table MAT_STG_TAB for MAT_TAB propagate immediate
set integrity for MAT_TAB materialized query immediate unchecked
set integrity for MAT_STG_TAB staging immediate unchecked

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

when i insert/update the base table, rows automotically get into the stagging table. i dont want the stagging table to be populated automatically. is there any way to refresh it deferred?

Thanks,
Arunvijay

DB2 Version : 8.1
Reply With Quote
  #2 (permalink)  
Old 04-04-08, 22:50
SuperKuper SuperKuper is offline
Registered User
 
Join Date: Apr 2008
Posts: 51
Use REFRESH DEFERRED keywords when CREATing the MQT.
__________________
db2topgun.com
Reply With Quote
  #3 (permalink)  
Old 04-07-08, 00:59
aveerabadran aveerabadran is offline
Registered User
 
Join Date: Mar 2008
Posts: 11
Pls note that - i have asked if there is any option available for refresh deferring "Stagging table" , and not MQT .
Reply With Quote
  #4 (permalink)  
Old 04-07-08, 08:09
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
Quote:
Originally Posted by aveerabadran
create table MAT_STG_TAB for MAT_TAB propagate immediate
By definition your staging tables will be updated right away. Here is a paragraph from the manual.

PROPAGATE IMMEDIATE The changes made to the underlying tables as part of a delete, insert, or update operation are cascaded to the staging table in the same delete, insert, or update operation. If the staging table is not marked inconsistent, its content, at any point-in-time, is the delta changes to the underlying table since the last refresh materialized query table.
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
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