Db2

Db2

Connect with Db2, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
Expand all | Collapse all

excluding some columns from Db2's Automatic Runstats

  • 1.  excluding some columns from Db2's Automatic Runstats

    Posted Sat March 22, 2025 07:18 AM

    Hello,

    i our dataware all tables contains theses technical colums: AUD_USER, AUD_TIME, AUD_JOURNAL ,AUD_SEQNO

    and we use the Automatic column group statistics  [(AUTO_CG_STATS) = ON].

    i'm looking for a solution to exclude all technical column from the Automatic column group statistics 

    i can exclude tables with DB2AutoRunstatsPolicy.xml but not column.

    i'm also testing the AI optimizer of the DB2 12.1, i have the same probleme, all models contains theses technical columns.

    Best regards,

    https://github.com/IBM/db2-samples/blob/master/automaintcfg/DB2AutoRunstatsPolicySample.xml



    ------------------------------
    malek shabou
    ------------------------------


  • 2.  RE: excluding some columns from Db2's Automatic Runstats

    Posted Wed March 26, 2025 11:51 AM

    Hello.

    It seems that there is no configuration making DB2 not to generate a statistics profile with CG statistics on some particular columns.
    The solution could be auto generation of `RUNSTATS ON TABLE` commands based on the SYSCAT.TABLES.STATISTICS_PROFILE column with a corresponding modification of the `AND COLUMNS ((..., ...), ..., (..., ...))` clause excluding all lists of columns including your columns.
    These amended commands can be executed then.

    Are you ready for such a workaround?



    ------------------------------
    Mark Barinstein
    ------------------------------