Book Image

Teradata Cookbook

By : Abhinav Khandelwal, Viswanath Kasi, Rajsekhar Bhamidipati
Book Image

Teradata Cookbook

By: Abhinav Khandelwal, Viswanath Kasi, Rajsekhar Bhamidipati

Overview of this book

Teradata is an enterprise software company that develops and sells its eponymous relational database management system (RDBMS), which is considered to be a leading data warehousing solutions and provides data management solutions for analytics. This book will help you get all the practical information you need for the creation and implementation of your data warehousing solution using Teradata. The book begins with recipes on quickly setting up a development environment so you can work with different types of data structuring and manipulation function. You will tackle all problems related to efficient querying, stored procedure searching, and navigation techniques. Additionally, you’ll master various administrative tasks such as user and security management, workload management, high availability, performance tuning, and monitoring. This book is designed to take you through the best practices of performing the real daily tasks of a Teradata DBA, and will help you tackle any problem you might encounter in the process.
Table of Contents (19 chapters)
Title Page
Dedication
Packt Upsell
Contributors
Preface
Index

Generating a unique row number


Teradata Database distributes rows to AMPs based on the hash values generated by the hash map algorithm. This data distribution algorithm is easy and efficient. The primary index of the table defines where the data will reside in which AMP. The uniqueness of this primary index becomes very important when distributing rows to AMPs.

If data is skewed, meaning residing on one or few AMPs, a query using the index becomes slow in processing and also causes space issues in the database:

 

This uniqueness of rows can be generated using the following methods:

  • Based on original data
  • ETL process, outside Teradata

The third method that we will be using is the identity column. The identity column feature allows for generating unique numbers for each row and inserting values into a column defined in the table. It is like generating sequence numbers automatically, which helps in preserving the uniqueness of the table.

Getting ready

You need to connect to Teradata Database using...