IBM Support

LI73603: INDEX SCAN USING EXCLUSIVE START KEY MIGHT RETURN INCORRECT RESULTS

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Incorrect scan results might be returned by an index scan if you
    have an index with at least three levels.
    
    The problem might only occur during an index scan if there is a
    concurrent transaction inserting or updating the same index,
    which causes a non leaf index page split. In particular, the
    problem occurs when the scan probes down from the index root
    page and needs to scan the same non-leaf index page that was
    affected by the index page split, and the index key that the
    scan needs to look for has since been moved away from the
    non-leaf page.
    
    
    For example, if you perform a query against index columns (i1,
    i2) and use exclusive start key (using  > or <, instead of >= or
    <=), incorrect rows might be returned:
    
    SELECT i1,i2 FROM t1 WHERE i1 > 14
    I1          I2
    ----------- -----------
             13          1
             12          1
             10          1
              5          1
              4          1
              3          1
              2          1
              1          1
      8 record(s) selected.
    
    In this example the correct results should have been:
    I1          I2
    ----------- -----------
             15           1
             16           1
             17           1
             18           1
             19           1
             20           1
      6 record(s) selected.
    

Local fix

  • Use an inclusive start key instead of exclusive start key. For
    example:
    SELECT i1,i2 FROM t1 WHERE i1 >= 15
    

Problem summary

  • USERS AFFECTED:  Users who have an index with at least three
    levels.
    
    PROBLEM DESCRIPTION:
    The problem might occur during an index scan if there is a
    concurrent transaction inserting or updating the same index,
    which causes a non-leaf index page split. In particular, the
    problem occurs when the scan probes down from the index root
    page and needs to scan the same non-leaf index page that was
    affected by the index page split, and the index key that the
    scan needs to look for has since been moved away from the
    non-leaf page.
    
    An index scan occurs when the database manager accesses an index
    for any of the following reasons:
    - To narrow the set of qualifying rows (by scanning the rows in
    a certain range of the index) before accessing the base table.
    - To order the output.
    - To retrieve the requested column data directly.
    If the index scan involves an index with at least three levels
    and involves an exclusive start key (which means that the key
    value will not be included in the scan), the results might be
    incorrect.
    
    PROBLEM SUMMARY:
    Incorrect scan results might be returned by an index scan on an
    index with at least three levels, exclusive start key is used on
    the start key for the index scan and there is concurrent
    transaction which split the index non leaf page at the right
    time.
    

Problem conclusion

  • Problem was first fixed in Version 9.5 Fix Pack 2
    

Temporary fix

  • Use inclusive start key instead of exclusive start key
    

Comments

APAR Information

  • APAR number

    LI73603

  • Reported component name

    DB2 UDE ESE LIN

  • Reported component ID

    5765F4104

  • Reported release

    950

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    YesHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2008-07-16

  • Closed date

    2008-08-29

  • Last modified date

    2008-09-08

  • APAR is sysrouted FROM one or more of the following:

    LI73598

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    DB2 UDE ESE LIN

  • Fixed component ID

    5765F4104

Applicable component levels

  • R950 PSY

       UP

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSEPGG","label":"DB2 for Linux, UNIX and Windows"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"950","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
08 September 2008