0% found this document useful (0 votes)
49 views21 pages

Index in Teradata: BY Raniendu Singh, Manisha Mishra, Mohd. Sameed

This document provides an introduction to indexes in Teradata, including: 1) It describes how indexes are used to define data distribution and access data quickly. There are two main types: primary indexes, which are always used for data distribution, and secondary indexes, which are optional. 2) Primary indexes in Teradata can be unique or non-unique, and there is always one primary index per table. Secondary indexes can also be unique or non-unique. 3) The document compares keys and indexes, noting that primary keys are a relational modeling concept while primary indexes serve the physical purpose of data distribution in Teradata.

Uploaded by

raniendu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views21 pages

Index in Teradata: BY Raniendu Singh, Manisha Mishra, Mohd. Sameed

This document provides an introduction to indexes in Teradata, including: 1) It describes how indexes are used to define data distribution and access data quickly. There are two main types: primary indexes, which are always used for data distribution, and secondary indexes, which are optional. 2) Primary indexes in Teradata can be unique or non-unique, and there is always one primary index per table. Secondary indexes can also be unique or non-unique. 3) The document compares keys and indexes, noting that primary keys are a relational modeling concept while primary indexes serve the physical purpose of data distribution in Teradata.

Uploaded by

raniendu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 21

INDEX IN TERADATA

BY
Raniendu Singh, Manisha Mishra, Mohd. Sameed
OBJECTIVES

• Introduction to Indexes

• Data Distribution in Teradata

• Types of Indexes

• Primary Indexes

• Secondary Indexes

• Key v/s Index

• Comparison between Indexes


INTRODUCTION

• Indexes are used to

- Define data distribution

- Locate and Access data quickly


DATA DISTRIBUTION

• Even Data Distribution

• Skewed Data Distribution


EVEN DATA DISTRIBUTION
SKEWED DATA DISTIBUTION
TYPES OF INDEX

• Primary Index
• Unique Primary Index (UPI)
• Non-Unique Primary Index (NUPI)

• Secondary Index
• Unique Secondary Index (USI)
• Non-Unique Secondary Index (NUSI)
PRIMARY INDEX

• Introduction
• Physical mechanism for data distribution and access
• Always one-AMP operation
• Created at time of table creation
• Most critical decision for DB designer
RULES FOR PI

• One PI per table


• Unique or Non-unique
• Can be Null
• Can be modified
• Column Limit
TYPES OF PI
DATA DISTRIBUTION
DUPLICATE ROW HASH VALUES
ACCESSING DATA WITH PI
SECONDARY INDEX

• Introduction
• SI Rules
• SI is optional
• Unique or Non-unique
• Can be Null
• Can be modified
• Column Limit
TYPES SECONDARY INDEX

• Unique Secondary Index

• Non-unique Secondary Index


ACCESSING DATA WITH USI
ACCESSING DATA WITH NUSI
KEYS V/S INDEX

Keys Indexes

A relational modeling A Teradata Database


convention used in a logical mechanism used in a physical
data model. database design.
Uniquely identify a row Used for row distribution
(Primary Key). (Primary Index).

Establish relationships Used for row access (Primary


between tables (Foreign Key). Index and Secondary Index).
INDEX COMPARISON

Rule Primary Key Foreign Key Primary Index Secondary Index


1 One PK Multiple FKs One PI 0 to 32 SIs
Unique or non-
2 Unique values Unique or non-unique Unique or non-unique
unique
3 No NULLs NULLs allowed NULLs allowed NULLs allowed
Values should not Values may be Values may be changed Values may be
4
change changed (redistributes row) changed
Column cannot be Index may be
Column should not Column should not
5 changed (drop and changed (drop and
change change
recreate table) recreate index)
6 No column limit No column limit 64-column limit 64-column limit
FK must exist as PK
7 n/a n/a n/a
in the related table
THANK YOU …

You might also like