Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 04 Sep 2003 @ 21:22:31 GMT


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


Subj:   Re: Rank top and bottom
 
From:   Figge, Jason

You could try the following:

SELECT Fields
FROM   Table
QUALIFY RANK(Field1) < 11 OR
        RANK(Field1 ASC) < 11

The difference between the two statements is that the UNION version would result in a 'Redistribution by hash code' and the double RANKed statement causes an 'assumed redistribution by value'. I'm guessing the later means that no data has to move (can someone confirm or deny this?). Also, if you have indexes defined and they were in use with the UNION statement, check that the introduction of the OR predicate hasn't caused a FTS (may or may not be slower).

Jason



     
  <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