Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 09 Jun 2005 @ 10:10:54 GMT


     
  <Prev Next>  
<<First
<Prev
Next> Last>>  


Subj:   Partition elimination using Date function
 
From:   Anomy Anom

<-- Anonymously Posted: Wednesday, January 21, 2004 07:04 -->

Hi ALL,

I am comparing a Date function with partitioning column of a table. But it goes for all partitions scan instead of partition elimination and it takes lot of time to complete the query.

Simple Query:

     CREATE SET TABLE CPK.t22 ,NO FALLBACK ,
          NO BEFORE JOURNAL,
          NO AFTER JOURNAL,
          CHECKSUM = DEFAULT
          (
           a INTEGER,
           b DATE FORMAT 'YY/MM/DD')
     PRIMARY INDEX ( a )
     PARTITION BY RANGE_N(b  BETWEEN DATE '2001-01-01' AND DATE '2006-12-30'
     EACH INTERVAL '1' DAY );

     Explain select * from t22 where b > date-20 and b < date;

If I use Date literals like (b > '2005-05-18' and b < '2005-06-08') then Part elim is happening as expected.

Could anyone suggest me any other ways/workaround to achieve the partition elimination using Date function instead of literals.


Thanks in advance.



     
  <Prev Next>  
<<First
<Prev
Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 27 Dec 2016