Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 01 Dec 2004 @ 18:24:18 GMT


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


Subj:   Re: ("1=1") condition in the explain plan
 
From:   Michael Larkins

Akleema:

The thing that normally causes the optimizer to use a join condition of 1=1 is that you did not provide a proper join condition in your query. Teradata cannot do a join without a join condition. If you do not provide one, it makes one up (1=1). The 1=1 is normally a Caresian Product join because 1 is always equal to 1. Therefore, normally whenever you see this, go back to your SQL and finish writing all of the join conditions. Whatever you do, do not run an SQL that has a product join with a condition of 1=1 unless you are trying to do a product join. A product join can be controlled using non-join (residual) condition(s) in your WHERE. In the newer form of the syntax, this is a CROSS JOIN which does not allow an ON comparison.


Hope this helps,

Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor



     
  <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