Improving SQL Performance with Simple Query Rewrites: Dealing with Duplicates and Business Calendars

sql2

The Teradata flavor of SQL is still, in principle, a declarative language. Hence, there can be multiple ways to describe an SQL query and achieve the same result. While the answer is the same, Teradata may use a completely different execution plan based on how the query is expressed. One approach is investing in heavy …

Read more

Teradata TD_WhichMax and TD_WhichMin Functions: A SQL Solution for Finding Min/Max Value of a Column with Low Resource Consumption

sql1

What is the Teradata TD_WhichMax Function? Teradata releases new SQL features with each update, providing enhanced functionality and improved performance with reduced resource usage. We will examine the Teradata TD_WhichMax and TD_WhichMin functions and explore their potential benefits. These functions retrieve the minimum or maximum value of a column and are commonly utilized in SQL …

Read more

Teradata Join Strategies: How to Optimize Join Operations

tune1

Introduction Teradata offers several methods for conducting joins, but all necessitate one prerequisite. The paired table rows must reside on identical AMPs. The chosen method for joining and relocating data is called a join strategy. The preparation for each join method varies. The choice of Teradata join strategy utilized by the Optimizer is determined by …

Read more

SQL Tuning Goals: Improving Performance and Reducing Resource Usage

tune4

Learn about the goals of SQL tuning and how to optimize database performance by reducing resource usage. Skew, IOs, and CPU seconds are key metrics. Discover how to ensure completeness and correctness of Teradata statistics, detect missing and stale statistics, and improve query plans.

Understanding Teradata DBQL Tables and Query Logging

admin4

Learn about Query Logging with Teradata DBQL Tables, a powerful feature for workload analysis and performance tuning. Configure settings and select which key figures to store and their level of detail. The article covers how to implement and activate DBQL tables, determine which information to collect, and analyze tactical queries.

Teradata Join Strategy: The Benefits and Costs of Merge and Product Join Methods

tune4

Teradata employs various join methods and techniques to merge the rows of two tables onto a single AMP, which is essential for joining. The combination of join technique and data geography is called the join strategy, and its goal is to reduce resource consumption (CPU seconds, I/Os). Some join methods, like the Teradata Merge Join, …

Read more

The Importance of Up-to-Date Statistics for Teradata SQL Tuning

tune1

1. Complete and up-to-date Statistics At the start of Teradata SQL Tuning, statistics are a vital concern. The Teradata Optimizer employs statistics to formulate the optimal execution plan for our query. The adequacy of statistics or dynamic AMP sampling varies according to the data demographics. To initiate optimization, updated statistics must be provided to the …

Read more

Teradata SQL Tuning: How Query Rewriting Can Reduce Runtime from 40 Minutes to Seconds

sql2

It’s time to share a new Teradata SQL tuning case study that showcases the impressive impact of query rewriting on performance. We are studying the query below that originally took 40 minutes to run. As a SQL tuning specialist, I always prioritize adding missing statistics and refreshing stale ones. I analyzed the SQL statement that …

Read more

How to Optimize Teradata Statistics and Avoid Heuristics: A Case Study

tune1

The Optimizer typically excels in utilizing statistics, yet examining the execution plan and cardinality estimations can sometimes be beneficial. Since Teradata 14.10, I have habitually included the SHOW STATISTICS statement in my considerations. The resulting metrics can aid in identifying statistical issues. Teradata Statistics – Avoid the Heuristics This case study demonstrates how the Optimizer …

Read more

Optimizing Teradata Requests with Group-AMP Operations for Improved Performance

tune4

All-AMP and single-AMP operations are well-understood. All-AMP retrieval typically involves full table scans, including NUSI sub-table scans. On the other hand, single-AMP retrieval typically involves indexed access, such as UPI and NUPI. Group-AMP operations optimize requests by minimizing the number of active AMPs. These operations fall between single-AMP and all-AMP operations. The Optimizer employs group-AMP …

Read more

DWHPro

Expert network for enterprise data platforms. Senior consultants, project teams built for your challenge — across Teradata, Snowflake, Databricks, and more.

📍Vienna, Austria & Jacksonville, Florida

Quick Links
Services Team Teradata Book Blog Contact Us
Connect
LinkedIn → [email protected]
Newsletter

Join 4,000+ data professionals.
Weekly insights on Teradata, Snowflake & data architecture.