IBM Support

IC81859: ESTIMATED CARDINALITY OF UNNEST FUNCTION FOR ARRAY DATATYPE IS NOT USED DURING QUERY PLANNING

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • The DB2 optimizer uses the maximum cardinality of an array
    during plan generation. In many cases the maximum cardinality is
    not a good indicator of the real array size, especially when
    arrays are used in stored procedures or packages. As a result,
    queries that use the UNNEST function with an array as input may
    have poor plans due to the high maximum array cardinality.
    

Local fix

  • As a workaround, the user may specify an estimated cardinality
    for the array by updating the statistics of the array cast
    function in SYSSTAT.ROUTINES table:
    
    
    db2 "update sysstat.routines set
    cardinality=<cardinality_of_array> where
    routineschema='<schema_name_of_array>' and
    routinename='<array_name>'"
    
    Dynamic statements will use the new cardinality at the next
    compile.
    Static packages will need to be rebound to use the new
    cardinality.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * All users on DB2 v97 FP5 and earlier                         *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to DB2 v97 FP6                                       *
    ****************************************************************
    

Problem conclusion

  • First Fixed in DB2 v97 FP6
    

Temporary fix

Comments

APAR Information

  • APAR number

    IC81859

  • 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-03-06

  • Closed date

    2012-06-26

  • Last modified date

    2012-06-26

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

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

    IC84502 IC84565

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • R970 PSY

       UP



Document information

More support for: DB2 for Linux, UNIX and Windows

Software version: 9.7

Reference #: IC81859

Modified date: 26 June 2012