Db2

Db2

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

 View Only

fullscan when not using hardcoded date on BLU database

  • 1.  fullscan when not using hardcoded date on BLU database

    Posted Thu April 08, 2021 09:35 AM

    Hi,

    his is my issue:

     

    TIR001.VITU is a column organised table with about 9 billion rows.

     D_E_DEM_DEM has a date type

     

    select count(*) from TIR001.VITU where TIR001.VITU.D_E_DEM_DEM= '2016-09-17'  is very fast, less then 5s

    but

    select count(*) from TIR001.VITU where TIR001.VITU.D_E_DEM_DEM=TRUNCATE((DATE('2016-09-19') - (DAYOFWEEK(DATE('2016-09-19'))) DAYS ))  

    take 7 minutes (it make a full tablescan) 

     

    ps: TRUNCATE((DATE('2016-09-19') - (DAYOFWEEK(DATE('2016-09-19'))) DAYS ))   == '2016-09-17' == last saturday

     

    any idea about this issue ?

     


    #Db2