Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 31 Jan 2003 @ 10:53:08 GMT


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


Subj:   Re: Query optimization: difference between inner join and derived table?
 
From:   David Wellman

Rafael,

How many rows in "table2" and how many unique values are there for column table2.rid?

What are the primary indexes of "table1" and "table2"?

What does the join plan for each query look like?

The second query will be reducing the "table2" values in column rid to a unique set, if this takes this table from lots of rows to a very few unique values then you've only got a very few rows being joined to "table1". The first query will quite possibly move one or both tables followed by a merge join between the two, with many many comparisons.


Cheers,

Dave



     
  <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