Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 20 Feb 2009 @ 23:06:03 GMT


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


Subj:   Re: Too much time spent on aggregate function
 
From:   Dieter Noeth

David Curley wrote:

  I'm curious about how RANK(), ROW_NUMBER() and MAX() would perform.  


  In theory you don't have to sort to get MAX(), you only have to read data, not sort it and write it back to disk. Does Teradata physically sort to get MAX() OVER()?  


Only a Teradata developer could answer that.

I think all those OLAP functions are implemented the same way, which can be seen in explain:

Rows are put into a spool and then redistributed into a second spool based on the PARTITION and ORDER BY columns.

But RANK got some special optimization, that's why it might be faster, especially when there are lots of rows per PARTITION.

You'd better test some variations and then check DBQL data.


Dieter



     
  <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