Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 21 Apr 2003 @ 23:08:48 GMT


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


Subj:   Re: Select * from mytable
 
From:   Chuck McDevitt

The problem with all these proposed solutions is that they are SLOW.

On every database system other than Teradata, SELECT * FROM MYTABLE is one of the fastest SQL statements you can issue. Data comes back sub-second, because those databases start sending the data back directly.

Teradata, on the other hand, writes the entire spool file before returning any rows.

Adding WHERE conditions to limit the number of rows in the spool helps a lot, but still often requires a full table scan before returning rows.

If you know of an indexed column, and know a value sure to exist, you can build a WHERE clause that works to return data fast. But often, you don't know that. You'd like to get a small number of rows from the table, and don't really care which, because what you want to see is some "example rows". Teradata just doesn't do this well.

Teradata could be changed to detect the case when there is no order by and no special processing, and instead of building the whole spool, start sending the rows back as they are ready.... I know this is a big change and would be a lot of work.

Of course, if you need the first 2000 rows in a particular order, you are out of luck anyway, since Teradata doesn't keep the rows in value order.



     
  <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