IBM Support

IT37840: INNER JOIN OF AT LEAST 4 COLUMN-ORGANIZED TABLES MIGHT RETURN WRONG RESULTS UNDER SPECIFIC CONDITIONS

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Under the following conditions, the query might return fewer
    rows than expected.
    
    1. at least 4 column-organized tables are joined using inner
    joins
    2. at least 3 of those tables have a primary key or unique index
    3. simple 'column=column' join predicates reference all the
    columns in the primary keys/unique indexes
    4. some of the columns appear in more than one 'column=column'
    join predicate
    5. it is NOT the case that all the keys are identical and all
    join to each other on all the columns
    
    The problem is dependent on the choice of access plan and the
    data.
    
    If the access plan (obtained via the EXPLAIN facility and
    db2exfmt)
    has the following specific characteristics, the query _might_ be
    vulnerable:
    
       FILTER <- applies at least one 'column=column' join predicate
    that joins
         |    <- only tables from the right-hand-side of the HSJOIN
    shown below
        ...
         |
      ^HSJOIN <- "^" indicates outer-early-out join
      /      \
    ...       more joins, including the "at least 3 tables"
    described above
    

Local fix

  • The problem can be avoided by setting registry variable:
    db2set -immediate DB2_EXTENDED_OPTIMIZATION="COLJOIN 1"
    
    If the registry variable is already set to a value,
    append "COLJOIN 1" to the existing setting, separated
    by a comma (no spaces).
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * Db2 Version 11.1                                             *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to Db2 Version 11.1 Mod 4 Fix Pack 7.                *
    ****************************************************************
    

Problem conclusion

  • Problem was first fixed in Db2 Version 11.1 Mod 4 Fix Pack 7.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT37840

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    B10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    YesHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2021-08-02

  • Closed date

    2022-04-17

  • Last modified date

    2022-04-20

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

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

    IT37911

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • RB10 PSN

       UP

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"DB2 for Linux- UNIX and Windows"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.1","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
03 May 2022