IBM Support

IC96826: DB2 OPTIMIZER MIGHT NOT CHOOSE A ONE-FETCH GROUP BY WHEN CARDINALITY IS UNDERESTIMATED

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The optimizer will consider an optimization for an SQL statement
    containing a MIN or MAX aggregation without a group by clause,
    referred to as a one-fetch group by operation, if the stream is
    ordered on the aggregation source column. You can identify if
    the group by operation is optimized as a one-fetch by collecting
    an EXPLAIN of the statement and searching for the ONEFETCH
    argument in the group by operator details:
    
                    ONEFETCH: (One Fetch flag)
                            TRUE
    
    If the input cardinality is significantly underestimated to
    value of 1 or less, then the optimizer might not choose to
    perform this optimization, and the ONEFETCH argument will not
    exist in the formatted EXPLAIN output.
    

Local fix

  • In most cases, collecting up-to-date statistics will improve the
    cardinality estimate if the SQL statement contains predicates
    that qualify the latest data in the table and the statistics are
    stale.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * DB2 OPTIMIZER MIGHT NOT CHOOSE A ONE-FETCH GROUP BY WHEN     *
    * CARDINALITY IS UNDERESTIMATED                                *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to DB2 V10 fixpack 4.                                *
    ****************************************************************
    

Problem conclusion

  • First Fixed in DB2 V10 FP4.
    

Temporary fix

  • In most cases, collecting up-to-date statistics will improve the
    cardinality estimate if the SQL statement contains predicates
    that qualify the latest data in the table and the statistics are
    stale.
    

Comments

APAR Information

  • APAR number

    IC96826

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    A10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-10-11

  • Closed date

    2014-06-10

  • Last modified date

    2014-06-10

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

    IC88478

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

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • RA10 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":"10.1","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
10 June 2014