Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 17 Mar 2004 @ 15:39:09 GMT


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


Subj:   NOT IN Alternatives
 
From:   Ferry, Craig

I am running a simple query

SELECT SQLCOR01.opportunity_id
FROM crm_eport.opportunities SQLCOR01
WHERE SQLCOR01.status IN ('Order Received', 'Not Started' ,'Hold'
,'Lost' , 'Won' )
AND SQLCOR01.branch_id = 7628

When I look at the explain plan, I see it is estimated with low confidence even though I have statistics collected on all columns of this table.

Is there a more efficient way to write this query?


Thanks

Craig


       
  2)Next, we do an all-AMPs RETRIEVE step from crm_eport.opportunities_tbl by way of an all-rows scan with a condition of ("(crm_eport.opportunities_tbl.branch_id = 7628) AND ((crm_eport.opportunities_tbl.status = 'Order Received') OR ((crm_eport.opportunities_tbl.status = 'Not Started') OR ((crm_eport.opportunities_tbl.status = 'Hold') OR ((crm_eport.opportunities_tbl.status = 'Lost') OR (crm_eport.opportunities_tbl.status = 'Won')))))") into Spool 1 (group_amps), which is built locally on the AMPs. The size of Spool 1 is estimated with low confidence to be 303 rows. The estimated time for this step is 0.06 seconds.  



     
  <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: 27 Dec 2016