
See how the nine sections connect query plans, row distribution, statistics and measured resource usage. Learn how to work through the explanations, demonstrations and assignments to build a practical tuning method.
Follow one SQL request through the parsing engine, BYNET and AMPs. Explain how parallel work depends on row distribution, and use three diagnostic questions to start investigating a slow query.
Trace a primary index value through row hashing, hash buckets and AMP placement. Compare unique and non-unique primary indexes, then weigh distribution, access and stability when choosing a primary index.
Explain why a busy AMP can delay an entire query step. Recognise skew from primary indexes and join columns, use skew-factor and value-count queries to investigate it, and understand why MULTISET alone does not fix distribution.
Compare the same sales rows under two primary indexes on a four-AMP lab system. Use row distribution and DBQL CPU figures to reveal skew that similar elapsed times can hide.
Work through a shortened join plan and identify how rows are read, moved and joined. Apply four questions to each step and distinguish optimizer estimates from evidence collected when the query runs.
Compare primary index, USI, NUSI, full-table-scan and join-index access. Identify the chosen path in EXPLAIN and explain the AMP involvement and work behind each option.
Explain why a query can run out of spool while total usage still looks low. Follow the 10,000-row lab comparison, check per-AMP spool and consider row distribution before increasing the limit.
Interpret no, low, high and index join confidence, including how input confidence affects a join. Recognise when missing statistics deserve investigation and why confidence alone does not prove an estimate is accurate.
Interpret Last Use, residual conditions, redistribution, local and global computation, duplicate elimination and partition counts. Use the Teradata 20.00 lab examples to connect plan wording with the next diagnostic question.
Read the plan for a sales report on a real Teradata system. Locate table duplication, local processing, a hash join and an estimate with no confidence, then separate estimated costs from measured execution.
Explain how matching rows reach the same AMP and how each join method matches them. Compare requirements and preparation costs, including situations where a product join can be a reasonable choice.
Follow a nested join from a small indexed input to matching rows in another table. Distinguish direct lookups from row-ID joins and identify the index requirements and corresponding EXPLAIN steps.
Explain how a sliding-window merge join handles partitioned inputs with different row ordering. Relate the number of windows to available memory and recognise how partition elimination can reduce the work.
Trace how a frequent join value can overload an AMP during redistribution. Explain how PRPD handles skewed values, why join-column statistics matter and how NULL join keys can contribute to skew.
Follow a Teradata 20.00 lab join with a frequent non-matching customer ID. Compare the plans with and without statistics, then examine filtering and RANDOM-based salting while considering which rows the join must preserve.
See how an expression on a join column can change row movement and estimation. Identify the relevant EXPLAIN clues, consider expression statistics and understand when a derived column or data-model correction is appropriate.
Compare a query with a missing join condition against its corrected version. Recognise inflated result counts and the product-join condition in EXPLAIN, and distinguish estimated costs from actual query results.
Use a DWHPro example to connect missing filter-column statistics with an inaccurate estimate. Explain how estimates influence join planning and identify which columns to consider first for statistics collection.
Follow how biased values and histogram intervals contribute to row estimates. Distinguish stored counts from derived estimates and use the example to understand why different predicates receive different estimates.
Investigate missing statistics, correlated columns, expressions, stale statistics and sampling. Match each cause to a possible remedy, then compare the revised estimate with actual row counts.
Compare summary, single-column and multi-column statistics in a Teradata 20.00 lab example. Explain how column correlation affects estimates and consider column order and query usage before collecting combined statistics.
Plan statistics maintenance using system and individual thresholds, sampling and DIAGNOSTIC HELPSTATS. Examine value distributions before sampling and use statistics-usage information to review what is worth maintaining.
Explain how AMP sampling and extrapolation help estimate tables when statistics are missing or stale. Use the lab example to recognise the limits of these estimates, especially with skew or irregular data growth.
Compare the actual count with EXPLAIN estimates before and after COLLECT STATISTICS on the status column. See confidence and accuracy change while the access plan stays the same; a better estimate is not itself a measured speedup.
Compare selecting all columns with selecting only those needed in a DWHPro join example. Explain effects on spool, joins and index coverage, while distinguishing row-storage scans from CLOB and column-partitioning behaviour.
Compare duplicate elimination and aggregation choices in Teradata. Decide when UNION ALL preserves the required result, inspect local versus global work and recognise the data-type consequences of the first SELECT.
Find a partial SUM step in EXPLAIN and see how early aggregation can reduce redistributed rows. Use the Teradata 20.00 lab example to understand why the optimizer makes this choice by cost rather than a fixed rule.
Compare UNION ALL with a two-row-driver rewrite in the lab. Check that results remain equivalent, compare the resulting work and watch for duplicate-handling and data-type differences.
Rewrite a moving sum and running total using window functions. Check row-based frames, date gaps and ties, then compare the lab resource usage without assuming that every window rewrite will be faster.
Build an investigation around the saved EXPLAIN plan, statistics, query steps and actual row counts. Choose a change based on the evidence, retest it and investigate regressions after statistics collection.
Compare estimates for equivalent filters in the Teradata 20.00 lab. Examine predicates on expressions, expression statistics and fixed-prefix LIKE patterns, including their relationship to partition elimination.
Follow a twelve-left-join case and examine how estimation errors can lead to a large duplicated spool. Compare the lab result of splitting the statement and learn why statistics and total resource usage should guide the decision.
Compare a constructed customer-code join with a join on the plain customer ID. Locate changes in duplication, redistribution and estimated rows in EXPLAIN, and consider whether consistent key storage would avoid the expression.
Explain row partitioning and RANGE_N, including NO RANGE and UNKNOWN. Connect the primary index and partition predicates to the work required, and use EXPLAIN to check whether partition elimination occurs.
Choose partition columns and granularity to match the workload. Review adding and dropping ranges, handling existing rows and maintaining date-based windows, including the work and locking implications of those operations.
Trace the index-subtable lookup and base-row access, involving at most two AMPs. Weigh uniqueness, storage and maintenance costs, review loader considerations and check index usage with DBC.IndexUseCountV.
Explain AMP-local NUSI subtables and why data-block access matters more than a simple percentage rule. Compare covering access and bit mapping, then use EXPLAIN to assess whether an index helps the query.
Examine how a value-ordered NUSI supports range access. Then consider secondary indexes on partitioned tables when a primary-index lookup lacks a partition predicate, and verify the selected access path in EXPLAIN.
Compare single-table, multi-table, aggregate and sparse join indexes. Explain how the optimizer can use stored results, weigh storage and update costs, and look for evidence of use in EXPLAIN and DBQL.
Compare a month-based report on plain and partitioned sales tables. Find the single-partition access in EXPLAIN, then contrast a store-only filter to see why the chosen partitioning must match the query.
Distinguish EXPLAIN estimates from logged execution metrics. Review BEGIN QUERY LOGGING, the relevant tables and views, thresholds and cache-flush delays so you can interpret the evidence available for tuning.
Rank expensive queries using DBQL resource figures and examine CPU/I/O relationships. Assess skew alongside totals so a query dominated by one AMP is not overlooked when choosing what to tune first.
Explain why elapsed time alone can mislead when system conditions change. Select an appropriate goal and DBQL measures, compare before-and-after runs fairly and distinguish tactical from strategic query priorities.
Set, update and remove key-value tags on requests, then retrieve them with GetQueryBandValue and DBQL. Use query bands to distinguish workloads and associate before-and-after measurements with the correct runs.
Read a top-five query-log report from the lab, including CPU, I/O, spool and SQL text. Identify the costly SET-table inserts and use the report to choose a concrete starting point for investigation.
Compare duplicate-row behaviour, session-mode defaults and the cost of duplicate checks. Relate loading performance to rows per primary-index value and consider how the table definition fits the required data semantics.
Review data-type sizing, nullability and multi-value compression as physical-design choices. Select compression values from the data and weigh block-level compression tradeoffs instead of assuming every smaller representation improves every workload.
Compare hash behaviour for selected data types in the lab and inspect an INTEGER-to-CHAR join in EXPLAIN. Explain why matching-looking values can still require conversion and why consistent key definitions matter.
Explain why a tiny table can still involve every AMP. Compare the historical single-AMP technique with sparse maps, identify suitable small tables and review how an existing table can be moved.
Explain how NoPI changes row placement and the work performed during loading. Review the relevant loading and access limitations, and consider how to move staged rows onward without introducing skew.
Compare initial and subsequent loads into lab tables with the same columns and primary index. Connect the measured difference to duplicate-row checks and distinguish this workload-specific result from a universal speedup claim.
Distinguish lock levels and severities, then trace how competing sessions can form a deadlock. Review row-hash lock upgrades, consistent lock order and shorter transactions as ways to reduce the risk.
Explain what the transient journal records and why undoing a large change can be expensive. Review alternatives for bulk modifications and recognise the operational consequences of long rollbacks, especially on skewed tables.
Examine how single-row inserts and non-concurrent load-isolation behaviour can block readers. Review the locking interactions, apparently safe settings and the alternatives demonstrated for avoiding the problem.
Connect AMP worker tasks, flow control and resource scheduling with query delays. Distinguish workload throttles and filters from query-plan problems, and understand how TASM rules and scheduling tiers influence execution.
Follow an open write transaction and a waiting read, then compare an ACCESS-lock read. Use the query-log timings to explain the difference and recognise the risk of reading uncommitted data.
Find the additional DWHPro resources introduced at the end of the course, including the Teradata book and spool guide. Use these references to continue exploring the topics most relevant to your own queries.
Find out why a Teradata query is slow—and choose a fix you can explain.
A query runs out of spool while most spool is still free. One AMP does most of the work. An EXPLAIN plan estimates far more rows than a query returns. This course shows you how to investigate problems like these using execution plans, SQL examples and evidence from a real Teradata system.
Teradata Performance Tuning in Practice is for SQL developers, ETL engineers, data engineers and DBAs who want a repeatable way to diagnose slow queries. You will learn to read the plan, identify the likely cause, choose a targeted change and check what happened when the query ran.
What you will learn to do
Read an EXPLAIN plan step by step, identify expensive data movement and distinguish optimizer estimates from measured results.
Recognise table and join skew, understand why one busy AMP can hold up a query, and evaluate ways to improve row distribution.
Diagnose error 2646 and explain why available total spool does not guarantee enough spool on every AMP.
Choose useful statistics and compare estimated row counts with actual counts.
Assess join strategies, SQL rewrites, indexes and partitioning in the context of the query you need to improve.
Use DBQL to find costly queries and investigate CPU, I/O and skew, then understand how locks and workload limits affect execution.
See the behaviour, then practise the diagnosis
The course combines short explanations, diagrams and SQL with nine practical demonstrations and nine assignments—one of each per section. Demonstrations include skew on a real system, reading an EXPLAIN plan, a forgotten join condition, statistics before and after collection, partition elimination and a writer blocking a reader.
Each section also includes a quiz. A timed final exam contains 36 questions, four per section, to help you identify which topics to revisit.
Nine sections build a complete tuning workflow
Query execution: shared-nothing parallelism, AMPs, hashing, primary indexes and skew.
Reading the plan: EXPLAIN steps, access paths, confidence levels and spool error 2646.
Join strategies: merge, hash, nested and product joins, sliding-window merge joins, and skewed joins.
Statistics: histograms, estimation errors and practical statistics collection.
Rewrites and method: SQL patterns and a repeatable approach to finding the root cause.
Indexes and partitioning: partition elimination, USI, NUSI and join indexes.
Finding expensive queries: DBQL, CPU and I/O costs, skew and query bands.
Physical design: SET and MULTISET tables, data types, compression and NoPI staging.
Concurrency: locks, deadlocks, transactions, AWTs, throttles and TASM.
What you need before starting
You should already be comfortable with SQL, including SELECT, JOIN and GROUP BY. Access to a Teradata or Vantage system helps you try the examples yourself, but is not required to follow the explanations and recorded demonstrations. This is an intermediate performance-tuning course.
About the material
The course is based on Roland Wenzlofsky’s DWHPro articles and the book Teradata Query Performance Tuning: The DWHPro Guide. The narration is AI-generated; the technical material comes from the instructor’s articles and book.
VantageCloud Lake scope
On VantageCloud Lake, this course applies to tables in block storage. Object File System tables have no primary index by default, and no row partitioning, secondary indexes or multi-table join indexes. Viewpoint on Lake monitors the primary cluster only.
Start with the free preview lectures to see how the course explains query execution, skew and EXPLAIN plans.