Solved

How? REFRESH TABLE of MQT in V5R3?

Posted on 2008-10-02
2
329 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn why we support net neutrality and why the topic is important to all internet users.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

696 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