Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sat, 24 Aug 2001 @ 18:11:49 GMT


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


Subj:   Re: Using Time(0)
 
From:   Michael Larkins

Hi Mike:

You have receive some very good CAST techniques to work around your problem. However, be aware that converting data is slow and converting converted data (CAST within a CAST) is very slow over millions of rows.

I have seen SQL generated out of Business Objects that uses this techique. It contained 2 of these. When we did date math instead, the run time went from 1 hour to 4 minutes and 47 seconds - a considerable savings.

If you are using these for comparison purposes, I would first try a correlated subquery, something like this:

WHERE < date-col > =(SELECT MAX(< date-col >) FROM < table >
             WHERE < domain-col-t1 > = < domain-col-t2 >)
AND < time-col > =(SELECT MAX(< time-col >) FROM < table >
             WHERE < domain-col-t1 > = < domain-col-t2 >)

Good luck,

Mike



     
  <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: 15 Jun 2023