Home Page for the TeradataForum
 
 

 

Archives of the TeradataForum





Message Posted: Wed, 21 Feb 2007 @ 18:29:08 GMT





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




Subj:   Avoid the Product Join
 
From:   Castelli Emanuel Alejandro



Hi all....

I need your help to try to avoid a Product Join in this query:

     select
     sum (case when b.range = 1 then 1 else 0 end),
     sum (case when b.range = 2 then 1 else 0 end),
     sum (case when b.range = 3 then 1 else 0 end)
     from
     table_a as a,
     table_b as b
     where
     a.duration between b.min_duration and b.max_duration;

The tables:

     table_a (duration is not part of the index)
     table_b (primary index: range, min_duration, max_duration)

Any ideas?


Thanks

Castelli, Emanuel Alejandro
Desarrollo DataWarehouse - IBM Argentina





     
  <Prev Next>  
<<First
<Prev
Next> Last>>  
 
 
 
 
 
 
 
 
  
 
  Top Home Join Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky 
Last Modified: 30 Jun 2008