Tech Interview Questions site organizes over 1000 tech interview questions from multiple job functions. All these are in an easy question and answer format.
Teradata performance tuning and optimization
collecting statistics
Explain Statements
Avoid Product Joins when possible
select appropriate primary index to avoid skewness in storage
Avoid Redistributions when possible
Use sub-selects instead of big "IN" lists
Use drived tables
Use GROUP BY instead of DISTINCT ( GROUP BY sorts the data locally on the VPROC. DISTINCT sorts the data after it is redistributed)
Use Compression on large tables
-----------------------------------
How teradata makes sure that there are no duplicate rows being inserted when its a SET table?
Teradata redirects the new inserted row as per its Primary Index to the target AMP (Access Module Processor) on the basis of its row hash value, and if it find same row hash value in that AMP then it start comparing the whole row, and find out if duplicate.
When the target table has UPI(Unique Primary Index) then the duplicate row is rejected with an error.
In case of a NUPI(Non-Unique Primary Index) then it is rejected without throwing any error
-----------------------------------
Several reasons using Global Temporary tables Versus Volatile Tables
GTS are ANSI compliant while VTs are not
GTS can have statistics while VTs cannot
GTS use Temp space while VTs use spool space
GTS retain contents accross a Teradata restart while VTs do not