In this recipe, we will list steps which will guide you to an overall health check of Teradata joins. This will be a high-level view of performance when it comes to JOINS
. Steps in this recipe will not be dependent on type of join. You can apply these to any join, based on the problem in the query:
- 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 the DDLs of all the objects, check the columns involved in joins.
- Execute
EXPLAIN
for the query by pressing F6 in SQLA or writingEXPLAIN
in front of the query and pressing F5. - In
EXPLAIN
, check for extremely high estimated rows or extremely low estimated rows and time; if these estimations are not in relation to table statistics, refresh the stats on the columns:
/*High Estimated Explain*/ 1) We do...