ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

DB2 Index and underlying Logical File

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • DB2 Index and underlying Logical File

    I am new to the IBM i platform.

    I assume that when an index is create through SQL CREATE INDEX there is a logical file created in support of that index. Is that underlying logical file available for use by compiled RPG programs using native I/O access? The environment is DB2 for i V7.1.

    Thanks in advance for your reply.

    Scott

  • #2
    They can be used, but you might want to describe specifically how you want to use them (and possibly why)
    Tom

    There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

    Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

    Comment


    • #3
      No an SQL index does not create a logical file, it will not even share access path with an existing logical file.
      Nevertheless SQL indexes can be used in composition with native I/O like any keyed logical file.

      Just have a look at the following article:
      Native I/O is widely used in RPG and COBOL programs for getting access to the data stored in the database. Data access is mostly performed with the help of data description specifications (DDS) keyed physical and logical files. Unfortunately DDS is an outdated technology, while all future development regarding the database and data access is only integrated into SQL. For profiting from the new indexing technologies in release 6.1, native I/O does not need to be replaced with embedded SQL. SQL indexes can be used with native I/O like any keyed logical file. Moreover, the enhanced indexing technologies could first be used with native I/O while the SQL query optimizer could only partially profit from these enhancements.This article explains how SQL indexes can be used in conjunction with native I/O and how native I/O can profit from the enhanced indexing technologies.

      Comment

      Working...
      X