Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 29 May 2012 @ 17:31:03 GMT


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


Subj:   Re: What is difference between Sample 10 and Top 10?
 
From:   Walter, Todd

The database is going to pick a statistically random sample of the result set to answer a SAMPLE query so it makes no difference if it is sorted or not - the ORDERBY is extra work for no value.

TOP 5 means something different if on an ORDER BY query than on a query without ORDER.

With ORDER, it means exactly the TOP 5 of the sorted set.

Without ORDER it means get the first 5 it can find as quickly as possible.

The latter will be very fast if that is the result you want.



     
  <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