Db2

Db2

Where DBAs and data experts come together to stop operating and start innovating. Connect, share, and shape the AI era with us.


#Data


#Data
#Databases
#Operatingsystems
#Db2
#Databasesolutions
 View Only
  • 1.  PK not enforced usage

    Posted 07/20/20 12:54 PM
    Hello,

    Apart from unicity, PK "not enforced" usage is disapointing regarding statistic lacks and I wonder what db2 optimizer can do with it really.
    I would have expected a "virtual index" being inserted in SYSCAT.INDEXES, therefore a PK on (col1, col2, col3) would have firstkeycard, first2keycards, etc ... available to the optimizer.
    But this is not implemented this way and we have to create a statistics profile with colgroups ourself.

    This is really annoying for card estimation.

    Best regards, JMB

    ------------------------------
    Jean-Marc BLAISE
    ------------------------------

    #Db2


  • 2.  RE: PK not enforced usage

    Posted 09/18/20 07:22 PM
    Hi JMB,

    i think it is usefull to be able to add a foreign key (RI) pointing to the table.

    without RI between Fact Tables and Dimension Tables, DB2 is a mess. query generate hash_join_overflows and uses all tempspace.

    Best regards,

    Malek SHABOU

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