Solved

How? REFRESH TABLE of MQT in V5R3?

Posted on 2008-10-02
2
315 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

There are many Password Managers (PM) out there to choose from. PM's can help with your password habits and routines, but they should not be a crutch you rely on too heavily. I also have an article for company/enterprise PM's.
Cloud-based technologies and services will continue to grow in popularity in 2017 thanks to the simple, scalable and cost-effective solutions they deliver. Here are three areas where cloud adoption is poised to really take off.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now