- Connect to the Teradata database using SQLA or Studio.
- Write SHOW in front of the query and execute it to get the list of all objects in the query, with their definitions.
- Once you have DDLs of all the objects, check the columns involved in joins.
- Execute EXPLAIN for the query by pressing F6 in SQLA or writing EXPLAIN in front of the query and pressing F5. Check for the OUTER keyword, which will indicate that the join is correct:
/*EXPLAIN of query*/ EXPLAIN sel A.* ,b.sal from td_cookbook.A_with_Leftjoin A left join td_cookbook.B_with_join B on a.cust_id=b.cust_id where B.cust_id is not null
- Check statistics on the columns involved. If required, collect statistics on the column involved in the left join.
- The WHERE clause ...