Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 21 Mar 2002 @ 21:36:34 GMT


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


Subj:   Re: Sample query
 
From:   Anwar P

If it is any consolation, casting TIME/TIMESTAMP to VARCHAR/CHAR should get you going. But you will be forced to spell out your columns. Please see sample below.

Anwar.

create table foo
(c int, t timestamp);

 *** Table has been created.

explain select * from foo sample 10;
Explanation
--------------------------------------------------
 
  1)First, we lock a distinct TEST1."pseudo table" for read on a RowHash to prevent global deadlock for TEST1.foo.  
  2)Next, we lock TEST1.foo for read.  
  3)We do an all-AMPs RETRIEVE step from TEST1.foo by way of an all-rows scan with no residual conditions into Spool 2, which is built locally on the AMPs. The size of Spool 2 is estimated with low confidence to be 60 rows. The estimated time for this step is 0.15 seconds.  
  4)We do an all-AMPs SAMPLING step from Spool 2 (Last Use) by way of an all-rows scan into Spool 1, which is built locally on the AMPs. Samples are specified as number of rows..  
  5)Finally, we send out an END TRANSACTION step to all AMPs involved in processing the request.  
  ->The contents of Spool 1 are sent back to the user as the result of statement 1.  


explain select c, cast(t as varchar(30)) from foo sample 10;

Explanation
--------------------------------------------------
 
  1)First, we lock a distinct TEST1."pseudo table" for read on a RowHash to prevent global deadlock for TEST1.foo.  
  2)Next, we lock TEST1.foo for read.  
  3)We do an all-AMPs SAMPLING step from TEST1.foo by way of an all-rows scan with no residual conditions into Spool 1, which is built locally on the AMPs. Samples are specified as number of rows..  
  4)Finally, we send out an END TRANSACTION step to all AMPs involved in processing the request.  
  ->The contents of Spool 1 are sent back to the user as the result of statement 1.  


 BTEQ -- Enter your DBC/SQL request or BTEQ command:


     
  <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