Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 09 Dec 2005 @ 15:08:46 GMT


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


Subj:   Re: How sample works?
 
From:   Dieter Noeth

Zdravko Sonje wrote:

  Can someone explain how "sample" works?  


  Explain for "select * from table1 sample 100" says:  


          >   (all_amps), which is built locally on the AMPs.  The
          >   result spool file will not be cached in memory.  The
          >   size of Spool 3 is estimated with low confidence to be
          >   11,767,538 rows.  The estimated time for this step is
          >   3 hours and 58 minutes.

This is probably not the sample step, it should look like:

     3) We do an all-AMPs SAMPLING step from .... by
        way of an all-rows scan with no residual conditions
        into Spool 1 (group_amps), which is built locally on the
        AMPs.  Samples are specified as a number of rows.
  Table table1 has 300 m records and I need only 100 records. What is the trick?  


As long as it's really just a "select * from table sample x;" (and your system is not a large one) this is supposed to be fast.

If you don't want a real sample, but just want to see some data and you're already on V2R6 use Microsoft syntax instead:

     select top 100 * from table;

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