Hi,
using 11.1.0.7 64 bit. I have a table T partitioned monthly on TRANSACTION_DATE with datatype DATE that has date-time values.
I want to create a virtual column DATE_KEY which will be either TRUNC(TRANSACTION_DATE) or TO_NUMBER(TO_CHAR(TRANSACTION_DATE,'YYYYMMDD')). DATE_KEY is a foreign key that will join to D_CALENDAR dimension.
QUESTIONS; 1) If query has D_CALENDAR.DATE_KEY = some date, will partition pruning occur on table T ?
2) Ideally, I would like DATE_KEY to be an INTEGER. Will the TO_NUMBER(TO_CHAR() slow the query down noticeably? If it does, then I'll go with TRUNC(TRANSACTION_DATE).
Thanks!
Adam