Solved

creating materialized view in ibm i series

Posted on 2016-10-04
5
48 Views
Last Modified: 2016-11-03
We want to create materialized view in IBM i series v7R1 instead of normal views as we are having performance issue. Could anyone let us know how to create & maintain materialized view .
0
Comment
Question by:Syed Shareef Ahmed
  • 2
  • 2
5 Comments
 
LVL 18

Assisted Solution

by:daveslash
daveslash earned 250 total points
ID: 41828893
From what you say in the question, it appears that you've successfully created the view, but you're experiencing some sort of "performance issue". Is that correct?

Would you please provide us with more details, such as the source for the view and deails of the performance issue?

Thanks!
DaveSlash
0
 
LVL 34

Accepted Solution

by:
Gary Patterson earned 250 total points
ID: 41829998
Are you sure you want to use a MQT?

At the moment, in IBM i DB2 though V7R3, MQTs are "point in time" snapshots - they are not dynamically updated as rows are inserted/updated/deleted in the underlying tables (MAINTAINED BY USER is the only maintenance option at create time).

As a result, they are generally only appropriate in systems where the dependent tables are undated infrequently - a data warehouse that is just updated once a day is the classic case, or where a point in time snapshot is acceptable.

Here's how to create them and maintain them:

http://www.ibm.com/support/knowledgecenter/ssw_ibm_i_71/sqlp/rbafymqt.htm
0
 

Author Comment

by:Syed Shareef Ahmed
ID: 41830500
Hi DaveSlash,

Thanks for the response.

Yes your are very correct we have successfully created some views from tables (file) and used in some of reports with those views. The reports are taking time to run but not always, some time it runs fine and other time it takes time. Those reports are also used by our customers through web.

so we thought to create  materialize view.

Regards,
Shareef
0
 
LVL 34

Expert Comment

by:Gary Patterson
ID: 41830848
Inconsistent query runtimes can have a number of causes, for example:

1) A major table could be substantially cached in memory from a previous query, causing occasional runs to be artificially fast.  We run into this when we're doing performance testing, and run similar tests back-to-back.  To get a true "cold cache" runtime, we have to clear memory pools before running the test to get a good comparative value.

2) Users may be making different selections in the application interface that cause substantially large queries - for example, if they can enter a date range.

3) System load may vary over time.  Contention for CPU, memory, disk resources, etc. can cause wide variations in query runtime performance.

If I was working on this problem, I'd capture some performance data and do a little investigation:

Determine time periods where same query performs well, and when it takes longer.  You might be able to just pull this from the DB2 SQL Plan Cache.  While you're at it look and see if there are indexes advised for the query, and look for other optimization opportunities for the problem query.

Look at Collection Services or iDoctor Job Watcher data from same period to see if you can correlate longer runtimes to high CPU, high disk busy %, etc.

IBM i DB2 Database Performance and Query Optimization manual has a lot of good info on analyzing and resolving performance problems like this:

https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rzajq/rzajqpdf.pdf

Regards,

- Gary
0
 

Author Closing Comment

by:Syed Shareef Ahmed
ID: 41871939
Thanks a lot all :)
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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

11 Experts available now in Live!

Get 1:1 Help Now