IBM Support

IC88478: 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:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to DB2 V97 FP9                                       *
    ****************************************************************
    

Problem conclusion

  • First fixed in DB2 V97 FP9
    

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

    IC88478

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    970

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2012-11-21

  • Closed date

    2014-02-14

  • Last modified date

    2014-02-14

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

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

    IC96658 IC96826

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • R970 PSN

       UP



Document information

More support for: DB2 for Linux, UNIX and Windows

Software version: 9.7

Reference #: IC88478

Modified date: 14 February 2014