IBM Support

LI75692: A RANGE JOIN PREDICATE JOINED TO A UNION ALL VIEW WITH A GROUP B Y CLAUSE MAY PRODUCE A SUB-OPTIMAL PLAN.

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Db2 may not push down a range join to a Union All view into the
    tables of the Union All view.This would prevent Db2 to produce
    a sub-optimal plan.
    .
    The following conditions must be met in order to hit this proble
    m:
    .
    1)  There is a Group By clause on the table and the Union
    All view of the range join predicate.
    2)  Any column from the table in the range join predicate
    derives from an expression that is not a column.
    .
    For example:
    .
    create table br1(tranid integer, trandate date, amount decimal);
    create table br2(tranid integer, trandate date, amount decimal);
    create view ua as (select * from br1 union all select * from
    br2);
    .
    create table datedim(durid integer, startdate date, enddate
    date);
    .
    create view vdatedim(durid, startdate, enddate)
    as
    (select  durid,
               case when month(startdate) = 3 then startdate + 1 day
    else startdate end startdate,
                enddate
     from     datedim
    );
    .
    select ua.trandate, count(tranid), sum(amount)
    from    ua, vdatedim
    where  ua.trandate between vdatedim.startdate and
    vdatedim.enddate
    group by ua.trandate
    ;
    .
    

Local fix

Problem summary

  • Db2 may not push down a range join to a Union All view into the
    tables of the Union All view.This would prevent Db2 to produce
    a sub-optimal plan.
    .
    The following conditions must be met in order to hit this proble
    m:
    .
    1)  There is a Group By clause on the table and the Union
    All view of the range join predicate.
    2)  Any column from the table in the range join predicate
    derives from an expression that is not a column.
     .
    For example:
     .
    create table br1(tranid integer, trandate date, amount decimal);
    create table br2(tranid integer, trandate date, amount decimal);
    create view ua as (select * from br1 union all select * from
    br2);
    .
    create table datedim(durid integer, startdate date, enddate
    date);
    .
    create view vdatedim(durid, startdate, enddate)
    as
    (select  durid,
               case when month(startdate) = 3 then startdate + 1 day
    else startdate end startdate,
                enddate
     from     datedim
    );
    .
    select ua.trandate, count(tranid), sum(amount)
    from    ua, vdatedim
    where  ua.trandate between vdatedim.startdate and
    vdatedim.enddate
    group by ua.trandate
    
    ;
    

Problem conclusion

  • apar li75692
    fixed >= v95 fpk7
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI75692

  • Reported component name

    DB2 UDE ESE LIN

  • Reported component ID

    5765F4104

  • Reported release

    950

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2010-09-02

  • Closed date

    2010-12-20

  • Last modified date

    2010-12-20

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

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

    LI75693 IC70922

Modules/Macros

  • ENG_SQNR
    

Fix information

  • Fixed component name

    DB2 UDE ESE LIN

  • Fixed component ID

    5765F4104

Applicable component levels

  • R950 PSN

       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:
20 December 2010