creating materialized view in ibm i series

Posted on 2016-10-04
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 .
Question by:Syed Shareef Ahmed
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
  • 2
LVL 18

Assisted Solution

by:Dave Ford
Dave Ford 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?

LVL 35

Accepted Solution

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:

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.

LVL 35

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:


- Gary

Author Closing Comment

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

Featured Post

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

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

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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

726 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