Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Casting in PPI definition - forum topic by Sen_td

$
0
0

Hi All,

I have a PPI table defined as like below,

CREATE SET TABLE SAMPLE.TEST ,NO FALLBACK ,
     NO BEFORE JOURNAL,
     NO AFTER JOURNAL,
     CHECKSUM = DEFAULT,
     DEFAULT MERGEBLOCKRATIO
     (
    EMP_ID INTEGER,
    DATE_ID    INTEGER NOT NULL,
    DATE_F    DATE NOT NULL
)
PRIMARY INDEX PI_TEST ( EMP_ID )
PARTITION BY RANGE_N(CAST(DATE_ID AS DATE) BETWEEN DATE '2013-04-01' AND '2014-12-31' EACH INTERVAL '1' DAY ,
NO RANGE);

DATE_ID is sourced from DATE_F column(just DATE --> INTERGER conversion).

As we have users query this table frequently using the integer column DATE_ID. In PPI definition, we are casting an INTEGER column to DATE and storing.

My question:

Would this approach result equal or better performance gain compared to having the PPI defined on DATE_F column
without casting and advising the users to use DATE_F column instead of DATE_ID column? If yes/no please explain!
 

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>