Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 24 Jul 2002 @ 10:20:53 GMT


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


Subj:   UNION ALL
 
From:   David Clough

Has anybody experienced execution times between two tables involving a UNION ALL resulting in much longer total times than those arising from two single statements?

For example, I used the following simple construct :

SELECT * FROM TABLEA

Performs in 11 seconds

SELECT * FROM TABLEB

Performs in 1 second

Whereas ...

SELECT * FROM TABLEA
UNION ALL
SELECT * FROM TABLE B

Performs in 26 seconds!

I understand from NCR that UNION is performed serially, so I would have expected an execution time of 12 seconds not 26.

All appropriate stats are on the tables and the explain shows both parts of the Union writing to the same Spool.

By the way, I tried reversing the construct i.e. Select from TableB Union All Select from TableA but still I get 26 seconds.

Any thoughts?

David.Clough



     
  <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