TechTalk: OPNQRYF Optimization

Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

One of the newer features of the OPNQRYF command on the AS/400 is the use of Dynamic Record Selection. OPNQRYF will automatically use Dynamic Record Selection when it finds an existing access path that it can use. This works fine if you're running over a small file or are selecting at least 90 percent of the file. However, when executed over a large file with a small selection group, the results are anything but good.

We discovered this when we moved from the S/38 to the AS/400. Several of our jobs started taking much more time to execute than on the S/38.

To get around this, we decided to change the OPTIMIZE parameter to *MINWAIT. This tells the optimizer to minimize the total time it takes to read the records, or in other words, create an efficient Open Data Path. In this case, the optimizer will ignore using Dynamic Record Selection. When we did this, our job went from executing in 1 1/2 hours to 10 minutes. In another example -- not at our shop -- a job went from executing in 9 hours to only 45 minutes. This is a dramatic improvement.

The Programming: Database Guide (SC21-9659-2) has scattered bits of information regarding the use of Dynamic Record Selection and performance considerations on the following pages: 6-14, 9-9, 9-32, 9-33, 9-37, and 9-38. Even after reading this information it is not entirely clear what the *MINWAIT will truly do for and to you. In this case, the desired result was achieved by eliminating the Dynamic Record Selection.

This is especially important to remember for those who are moving from the S/38 to the AS/400. Since the S/38 did not use Dynamic Record Selection during OPNQRYF, this change can have an immense impact on the users when you move to the AS/400.

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: