Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 07 Jun 2012 @ 23:06:40 GMT


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


Subj:   Re: Impact on spool between SELECT TOP and with ORDER BY
 
From:   Walter, Todd

The two queries mean two different things. With the ORDER BY the database must execute the whole query and sort the whole result to ensure that the first N per the sort order are returned - this will take more spool. But the top N without order by will just go read that many rows from the table without having to sort or read the whole source.



     
  <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