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

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

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

Negative Impact of Applying Functions to Join Columns in Teradata Joins: Performance Implications and Solutions Popular

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

Functions on Join Columns and Their Impact on Teradata Performance In many Teradata systems, developers apply functions directly in join conditions to work around data-model inconsistencies.While this approach might seem harmless, it can dramatically affect optimizer decisions and query performance — and often reveals deeper data-model issues. Example of a Problematic Join Applying functions to …

Read more

Understanding Teradata Statistics Histograms: How the Optimizer Estimates Cardinality for WHERE Conditions

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

Teradata Statistics Histograms – A Short Introduction Many are familiar with the Optimizer’s statistical confidence levels. I was recently surprised to discover that a “high confidence” rating does not guarantee a fully accurate estimation (provided the statistics collected are not stale). While I remain hopeful that my observations may be attributed to a bug, I wanted …

Read more

Mastering Teradata Performance Tuning

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

This is a historical Teradata 14.10 case study. The small current-release fixture confirmed that the two DELETE variants preserved the same tested rows; it did not reproduce the historical runtime gain. The abbreviated histogram and plan excerpts are explanatory output, not executable setup scripts. The Art of Teradata Performance Tuning As a Teradata Performance Tuner, …

Read more

SQL Tuning Goals: Improving Performance and Reducing Resource Usage Widely read

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

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.

Optimizing Teradata Performance through Statistics and Primary Index Selection Widely read

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

1. Statistics In Teradata, understanding and managing statistics is essential for optimizing database performance. Statistics provide the optimizer with precise data about stored information, allowing for well-informed decisions when handling queries. This article will explore the significance of statistics in Teradata, their effect on query performance, and recommended methods for upkeep. The Role of Statistics …

Read more

Teradata MERGE INTO vs. UPDATE: Performance Comparison and Limitations Popular

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

Teradata MERGE INTO vs. UPDATE This article compares the UPDATE statement to the MERGE INTO statement, analyzing their respective performance differences and limitations. The Teradata MERGE INTO statement positively impacts performance by reducing I/O operations through the following properties. The displayed historical MERGE plan avoids the update spool shown in the comparison. MERGE can use …

Read more

Teradata Tactical Workload

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

Introduction This blog post discusses tactical workloads on a Teradata system. Despite Teradata’s implementation of features that support tactical workloads, this workload category remains challenging to manage. Selecting an optimal physical design is essential to meet user expectations for query speed. Designing the Teradata tactical workload on a test environment can be frustrating, especially when …

Read more

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

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

The DBQL example needs configured logging and a bounded time window. HASHAMP()+1 assumes the relevant map/AMP scope; it may misrepresent a request using only a subset of AMPs. Use the actual participating-AMP count for meaningful skew/impact calculations, and clear temporary query bands after the measured workload. 1. Complete and up-to-date Statistics At the start of …

Read more

What is Teradata Query Rewriting? Top 6 Optimization Techniques Explained Popular

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

What is Teradata Query Rewriting? Teradata query rewriting is an integral component of the optimization process for Teradata. The optimizer replaces your query with a more efficient and faster version. Both queries must produce identical results. Teradata implements various optimization techniques to enhance performance. We will demonstrate the commonly used optimization methods. 1. Removing unreferenced …

Read more