What are Deadlocks in Teradata? Deadlocks arise when two transactions hold locks on database objects required by the other transaction. Here is an example of a deadlock: Transaction 1 locks some rows in Table 1, and transaction 2 locks some rows in T...
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...
This article will show a case study from my past projects. It is an implementation in which, from a row per primary key that contains a start date and an end date, rows are to be generated for all days in between. I have simplified the query for demo...
Occasionally, it is necessary to utilize a cursor within a stored procedure to execute specific functionality. I recently encountered a stored procedure that contained a loop with multiple INSERT statements executed through a cursor. This particular...
Discover how Teradata summary statistics provide valuable information about the number of rows in a table, helping to optimize performance tuning.
Teradata ORDER BY and Performance If we chose a simple sort method, all rows would have to be available in one place to be sorted. This is, of course, not possible in Teradata, as hundreds of AMPs hold a portion of each table. Copying all rows to one...
In a previous article, Roland explained how to use recursion to build a data range without touching a physical table. This time, we explore an alternative approach that avoids recursion at the expense of single-AMP, single-row access. We can use this...
Learn about the differences between GROUP BY and DISTINCT for aggregations in Teradata. The optimizer now selects the appropriate algorithm depending on data demographics. Understand when to use each method to optimize query performance.
A Teradata Transient Journal is a dictionary table maintained across the whole system to protect transactions against system failures and deadlocks. Each AMP manages its local Transient Journal, where the table rows are copied before being changed by...