How to get SQL Query Stats in Teradata Popular

Illustration of a stopwatch dial on an orange paint-splash background

Learn how to determine SQL Query Performance in Teradata with these three essential parameters: AMPCPUTime, TotalIOCount, and SpoolUsage. Discover how to get SQL Query Stats and make the right decision for your queries using the DBC tables DBQLOGTBL and DBQLSQLTBL. Follow these three points to consider while running the query and get accurate results.

6 Teradata SQL Tuning Tips: Joins, Functions, UNION and GROUP BY Widely read

Illustration of a glossy orange database cylinder with data fragments across its surface

1. Avoid multiple Joins to the same table The shown MAX/CASE rewrite is grouped aggregation, not a window operation. It can collapse duplicate calls and retain unmatched subscribers that the original WHERE rejected; it is not an equivalent replacement without additional cardinality and match assumptions. This example showcases how to apply an ordered analytical function …

Read more

Teradata DDL from DBC: Legacy Generator and SHOW TABLE Popular

Illustration of a glossy orange database cylinder with data fragments across its surface

Compatibility note: this downloadable generator is retained as a historical example, not a supported replacement for SHOW TABLE. On Teradata Database 20.00.28.81 it returned no DDL for a simple existing test table, while SHOW TABLE returned the definition. Use SHOW TABLE database_name.table_name; for the current table DDL and verify dependent objects separately before recreation. A …

Read more

Teradata Historisation – Daily snapshot to change history

Illustration of a glossy orange database cylinder with data fragments across its surface

For various reasons, we may need to switch our Teradata historisation from snapshot tables to a start date/end date logic table, which I usually call a change history, as only changes trigger a historisation. A principal motivation for such a move away from a daily snapshot table could be space restrictions. The former full conversion …

Read more

Protected by Security by CleanTalk and CleanTalk Anti-Spam