DWHPro Insights

SQL Tuning

Understanding Teradata’s SAMPLE Function: Randomly Select Rows and More Widely read

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

What is the Teradata Sample Function? The SAMPLE function returns a set of randomly selected rows. Here are the characteristics: The Syntax of the Sample Function SAMPLE [WITH REPLACEMENT] [RANDOMIZED ALLOCATION][WHEN <condition> THEN] {<number of row> | <percentage>} […,<number-of-rows> | <percentage>][ELSE {<number of rows> | <percentage } END] Here are some examples of how to …

Read more

Optimizing Join and Aggregation with Teradata UNION ALL Views Widely read

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

Teradata 16 introduces a new option for handling sets of rows combined with “UNION ALL” in views and derived tables, reducing resource usage. The optimizer can apply aggregation steps and join operations to each branch of the “UNION ALL” separately, resulting in smaller spool sizes and improved performance.

Practical Approach for Teradata SQL Tuning: Finding the Root Cause of Performance Issues Most read

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

To optimize Teradata SQL performance, it is crucial to identify the root cause of any issues. The SQL statement itself is typically not the culprit but rather one or more stages of the execution plan. 🎓 Prefer video? Lecture 18 of my Udemy course Teradata Performance Tuning in Practice, “A practical tuning method: finding the …

Read more

Protected by Security by CleanTalk and CleanTalk Anti-Spam