Optimizing Teradata System Performance: Identify and Improve Resource-Consuming Queries

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

Improve the Performance of your Teradata System Executing the following query may reveal that a small number of queries are responsible for consuming a significant portion of the resources in the Teradata System. Improving the performance of these queries can greatly impact the system’s overall health. Your Teradata System’s parallel efficiency is crucial to its overall health. …

Read more

Achieve Incredible Teradata Join Performance

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

Executive summaryGUEST POST BY ARTEMIY KOZYR Today I shed some light on how Data Warehousing lies at the core of Retail Banking operations. We will see the actual case of vital marketing process malfunction and dive deep under the surface level to comprehend data alchemy technical issues. You will learn how to approach such issues, …

Read more

Teradata Multivalue Compression and Presence Bytes for NULL Values

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

Multivalue compression and null indication serve distinct purposes yet share a common objective of storing information about the values of each row’s columns. To conserve space, Teradata utilizes presence bytes to retain information on multivalue compression and nullability. Readers familiar with earlier releases will recognize that the name “presence byte” originally referred only to NULL …

Read more

Optimizing Teradata Requests with Group-AMP Operations for Improved Performance

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

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

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

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.

Is Teradata Compression Worth Your Time and Effort?

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

Teradata DBMS offers various compression options to save disk space and improve performance. But, the cost of implementing the compression takes man-time. This article discusses the cost vs. benefit of compression and suggests carefully considering the compression setting when designing new or modifying existing tables.

Teradata 16 Introduces New Features for UNION ALL Queries

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

Teradata UNION ALL – The New Features of Release 16 Teradata 16 introduces new features for UNION ALL queries that can enhance their performance, although their application is not guaranteed. The Optimizer will opt for executing the query through conventional methods if the cost estimations for the traditional execution plan are lower. It is crucial …

Read more

Introduction to Teradata Big Data Blocks: Advantages and Disadvantages

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

Teradata Big Data Blocks – Introduction Teradata 13.10 introduced larger file systems components, such as cylinders and data blocks. The cylinder size was increased from 1.9 MB to 11.3 MB, while the data block size limit was raised from 127.5 KB to 1 MB in Teradata 14.10. Teradata 14.10 allows temporary rows in spool space …

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.