Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 21 Apr 2003 @ 16:56:02 GMT


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


Subj:   Re: Select * from mytable
 
From:   Dieter N�th

Anomy Anom wrote:

  MyTable has tens of millions of rows.  


  The astute user wants to look at the first 2000 rows so they enter:  



There are no _first_ rows in a relational table (without Order By).


  lock MyTable for access
Select * from MyTable;
 


  Explain says the query will use an all amps retrieve. Why do the nodes take over 2 minutes to start returning rows when there is no one on the system? Based on experience with other database systems I expect the system to start returning rows.  


Teradata first spools _all_ rows and then starts returning data.

Why don't you use a

Select * from MyTable sample 2000;


This will return 2000 random rows.


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