Solved

How? REFRESH TABLE of MQT in V5R3?

Posted on 2008-10-02
2
325 Views
Last Modified: 2012-05-05
Per DOCs ....
I quote
        "You should avoid using the REFRESH TABLE statement to update user-maintained materialize query tables."
and again
        "Use insert, update, delete, or load operations might be more efficient than using the REFRESH TABLE statement."

Can I please get sample refresh syntax ..... if my MQT table was named MYLIB.MYTABLE



0
Comment
Question by:volking
2 Comments
 
LVL 5

Author Comment

by:volking
ID: 22626170
P.S. Below does work ... wonder why I should "AVOID USING"?

REFRESH TABLE MYLIB.MYTABLE;

Volking
0
 
LVL 27

Accepted Solution

by:
tliotta earned 500 total points
ID: 22627531
Volking:

I think it simply comes down to the resources necessary to effect a manual REFRESH. If you're going to go that route, it's far less resource intensive simply to use a VIEW (or VIEWs) over the actual data.

A REFRESH essentially starts with a CLRPFM. It then runs according to the SQL that defines the MQT and does all of the physical I/O that that implies, copying all data into the MQT table.

Why run all of that when a VIEW can go straight to the real data with no intermediate physical I/O?

Note that it is necessary to determine the value of MQTs before deciding to implement them. The value appears to be in the summarization of lots of data. As new releases of i5/OS come out, the capabilities of MQTs increase. They were just introduced in a basic form in V5R3 to let developers learn about them. V5R4 added details and V6R1 has added more.

The V5R3 implementation is something like giving you what you need to create a "Hello, World" kind of MQT. None of the nicer stuff was available yet.

Even so, if a MQT isn't really appropriate for a business problem, maybe it shouldn't be used.

Here's one possible informative resource -- Creating and using materialized query tables (MQT) in IBM DB2 for i5/OS, by Michael W. Cain, DB2 for i5/OS Center of Competency:

http://www-304.ibm.com/jct09002c/partnerworld/wps/servlet/ContentHandler/SROY-6UZ5E6

It includes a lot of V5R4 references, so it might not be as helpful as it could be for you. But it might help you decide if a MQT fits your needs and how it should be handled.

Tom
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to return the decimal value for AS400 query using Access 13 276
Driver Where can I find IBMDA400 driver software 5 2,803
Export Data from AS400 29 698
SQL Stored Procedure Authority 3 19
This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
This article explains the steps required to use the default Photos screensaver to display branding/corporate images
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question