• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Here’s Help For A Huge Hardship

    April 16, 2014 Ted Holt

    Multimillion-row tables are more and more common in IBM i shops these days. Querying those monsters can be a strain on the system. Fortunately, IBM gave us some help in DB2 for i 7.1.

    The help comes in the form of a new wrinkle in indexing. The smart people who produce the world’s greatest relational database management system found a way to store aggregate (summary) information in encoded vector indexes. Here’s an example.

    Assume a table (physical file) of sales history, such as this one:

    create table Sales
      ( ID                integer as identity,
        Invoice           dec  (9,0),
        Line              dec  (3,0),
        InvoiceDate       date,
        Customer          dec  (7,0),
        Item              char (12),
        Quantity          dec  (3,0),
        Price             dec  (5,2),
      primary key (ID));
    

    Suppose that users commonly want to know how many of each item was sold and how much money each item placed into the company bank account. You might use a query like this one:

    select item,
           sum(quantity) as Qty,
           sum(quantity * price) as Extended
      from sales
     group by item
     order by 1
    

    Each time the query runs, the system has to rebuild the summary figures.

    You might improve performance by creating the following encoded vector index:

    create encoded vector index SalesByItem
     on sales (item)
     include (sum(quantity), sum(quantity * price))
    

    This index includes two summary figures for each item: the sum of the quantity and the sum of the quantity multiplied by the price. As rows are added to, deleted from, or changed in the table, the system adjusts the summary figures. When a query needs these figures, it can read them from the index instead of rebuilding them.

    My thanks to Tom McKinley, of IBM, who reminded me of this new feature in his informative presentations at the recent RPG & DB2 Summit in Texas. I had forgotten that this feature existed.

    RELATED STORY

    Enter the Vector, Victor!



                         Post this story to del.icio.us
                   Post this story to Digg
        Post this story to Slashdot

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    ARCAD Software

    Embrace VS Code for IBM i Development

    The IBM i development landscape is evolving with modern tools that enhance efficiency and collaboration. Ready to make the move to VS Code for IBM i?

    Join us for this webinar where we’ll showcase how VS Code can serve as a powerful editor for native IBM i code and explore the essential extensions that make it possible.

    In this session, you’ll discover:

    • How ARCAD’s integration with VS Code provides deep metadata insights, allowing developers to assess the impact of their changes upfront.
    • The role of Git in enabling seamless collaboration between developers using tools like SEU, RDi, and VS Code.
    • Powerful extensions for code quality, security, impact analysis, smart build, and automated RPG conversion to Free Form.
    • How non-IBM i developers can now contribute to IBM i projects without prior knowledge of its specifics, while ensuring full control over their changes.

    The future of IBM i development is here. Let ARCAD be your guide!

    Watch Now

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    Essextec:  Linux on Power. Lunch on us. A winning combination.
    LANSA:  Webinar: Mobile and the IBM i: Why Should You Care? May 21, 9 am PT/11 am CT/Noon ET
    COMMON:  Join us at the COMMON 2014 Annual Meeting & Exposition, May 4 - 7 in Orlando, Florida

    More IT Jungle Resources:

    System i PTF Guide: Weekly PTF Updates
    IBM i Events Calendar: National Conferences, Local Events, and Webinars
    Breaking News: News Hot Off The Press
    TPM @ EnterpriseTech: High Performance Computing Industry News From ITJ EIC Timothy Prickett Morgan

    Electronic Storage Taps Japanese Reseller to Carry LaserVault UBD IBM i TR8, Database Driven

    Leave a Reply Cancel reply

Volume 14, Number 9 -- April 16, 2014
THIS ISSUE SPONSORED BY:

Help/Systems
WorksRight Software
Bug Busters Software Engineering

Table of Contents

  • The Geezer’s Guide to Free-Form RPG, Part 2: Data Structures and More
  • Here’s Help For A Huge Hardship
  • Admin Alert: Elements Of An IBM i Incident Management Plan, Part 2

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Meet The Next Gen Of IBMers Helping To Build IBM i
  • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
  • Will Independent IBM i Clouds Survive PowerVS?
  • Now, IBM Is Jacking Up Hardware Maintenance Prices
  • IBM i PTF Guide, Volume 27, Number 24
  • Big Blue Raises IBM i License Transfer Fees, Other Prices
  • Keep The IBM i Youth Movement Going With More Training, Better Tools
  • Remain Begins Migrating DevOps Tools To VS Code
  • IBM Readies LTO-10 Tape Drives And Libraries
  • IBM i PTF Guide, Volume 27, Number 23

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle