Teradata Access Paths: 8 Essential Ones to Know

tune1

The optimizer has various access paths to consider when creating the execution plan, each with unique advantages and disadvantages. This article will introduce the 8 most essential access paths. The lack of a hash index may surprise you; however, Teradata has entirely substituted it with the single-table join index and discourages its utilization in the …

Read more

Maximizing Performance with Multiple Teradata Sessions

tune2

Teradata Sessions explained in a few Sentences Example 1: Multiple Sessions which do not improve performance The graph shows that all four transactions (T1, T2, T3, T4) are concurrently active on all AMPs. Even for a single-row lookup, these transactions necessitate accessing all AMPs. None of the transactions use a single rowhash for access, resulting …

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

Learn Teradata Indexing Techniques in this 2-Hour Video Course

tune2

Introduction

Teradata SQL lacks a built-in function to determine the ASCII code of a character. But fear not, for there exists a query workaround to this dilemma. This blog post will guide you through the process of using a straightforward SQL query in Teradata to find the ASCII code of a character.

The solution is as follows:

We use the Teradata SQL function CHAR2HEXINT to obtain a hexadecimal value for a character. Our objective is to convert this hexadecimal value to its decimal counterpart, which signifies the character’s ASCII code.

This SQL query accomplishes the task.

SELECT
CASE SUBSTRING(CHAR2HEXINT('B') FROM 3 FOR 1)
WHEN '0' THEN 0
WHEN '1' THEN 1
WHEN '2' THEN 2
WHEN '3' THEN 3
WHEN '4' THEN 4
WHEN '5' THEN 5
WHEN '6' THEN 6
WHEN '7' THEN 7
WHEN '8' THEN 8
WHEN '9' THEN 9
WHEN 'A' THEN 10
WHEN 'B' THEN 11
WHEN 'C' THEN 12
WHEN 'D' THEN 13
WHEN 'E' THEN 14
WHEN 'F' THEN 15
END * 16 +
CASE SUBSTRING(CHAR2HEXINT('B') FROM 4 FOR 1)
WHEN '0' THEN 0
WHEN '1' THEN 1
WHEN '2' THEN 2
WHEN '3' THEN 3
WHEN '4' THEN 4
WHEN '5' THEN 5
WHEN '6' THEN 6
WHEN '7' THEN 7
WHEN '8' THEN 8
WHEN '9' THEN 9
WHEN 'A' THEN 10
WHEN 'B' THEN 11
WHEN 'C' THEN 12
WHEN 'D' THEN 13
WHEN 'E' THEN 14
WHEN 'F' THEN 15
END

Using a CASE statement, the query extracts two hexadecimal digits with the SUBSTRING function and converts them to decimal values. It then calculates the character’s ASCII code by multiplying the first digit’s decimal value by 16 and adding the second digit’s decimal value.

Conclusion

Teradata SQL lacks a dedicated feature for determining the ASCII code of a given character. However, this blog post offers a straightforward and efficient workaround for this issue. By utilizing the CHAR2HEXINT function and performing basic arithmetic operations, you can effectively determine the ASCII code of any character within your Teradata SQL queries.

Optimizing the Tactical Workload in Teradata: Skills and Tools Needed

admin3

Learn about tactical workload tuning in Teradata, which requires unique skills and tools. This article covers the skills needed to optimize tactical queries and highlights the difference between tactical and decision support workloads. Discover the Tactical Workload Toolkit and how to use join indexes for optimization.

Teradata Unique Secondary Index: Everything You Need to Know

tune4

Learn about Teradata’s unique secondary indexes (USI) and how they provide an alternate access path to reduce disk IOs while retrieving data. This article explains the technical differences between USI and other indexes, and provides detailed information on the data retrieval process. Discover how to create and use USI effectively, and why recent statistics and high selectivity are important factors to consider. Don’t miss out on this unique insight into Teradata indexing!

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.