SlideShare ist ein Scribd-Unternehmen logo
1 von 14
1
Introduction to Teradata
2
How Teradata Works
3
How DoesTeradata Store Rows?
ï‚Ą Teradata uses hashing algorithm to randomly and evenly distribute data across all AMPs.
ï‚Ą The rows of every table are distributed among all AMPs - and ideally will be evenly distributed
among all AMPs.
ï‚Ą Each AMP is responsible for a subset of the rows of each table.
ï‚Ą Evenly distributed tables result in evenly distributed workloads.
ï‚Ą The data is not placed in any particular order
The benefits of unordered data include:
ï‚Ą No maintenance needed to preserve order, and
ï‚Ą It is independent of any query being submitted.
The benefits of automatic data placement include:
ï‚Ą Distribution is the same regardless of data volume
ï‚Ą Distribution is based on row content, not data demographics
4
Primary Indexes
 The mechanism used to assign a row to an AMP
 A table must have a Primary Index
 The Primary Index cannot be changed
UPI  If the index choice of column(s) is unique, we call this a UPI
(Unique Primary Index).
 A UPI choice will result in even distribution of the rows of the
table across all AMPs.
NUPI  If the index choice of column(s) isn’t unique, we call this a NUPI (Non-
Unique Primary Index).
 A NUPI choice will result in even distribution of the rows of the table
proportional to the degree of uniqueness of the index.
UPI’s guarantee even data distribution and eliminate duplicate row checking.
Why would you choose an Index that is different from the Primary Key?
‱ Join performance
‱ Known access paths
5
Data Storage based on Primary Index
 The value of the Primary Index for a specific row determines its AMP assignment.
 This is done using the hashing algorithm.
PIValue
AMP AMP AMP
PE
Row assignment
Row access
Hashing
algorithm
Accessing the row by its Primary Index value is:
 Always a one-AMP operation
 The most efficient way to access a row
6
Row Distribution Using a UPI
Order
Number
Customer
Number
Order
Date
Order
Status
PK
UPI
7325
7324
7415
7103
7225
7384
7402
7188
7202
2
3
1
1
2
1
3
1
2
4/13
4/13
4/13
4/10
4/15
4/12
4/16
4/13
4/09
O
O
C
O
C
C
C
C
C
The PK column(s) will
often be used as a UPI.
PI values for Order_Number
are known to be unique (it’s a PK).
Teradata will distribute different
index values evenly across AMPs.
Resulting row distribution
among AMPs is uniform.
AMP 1 AMP 2 AMP 3 AMP 4
7202 2 4/09 C
7402 3 4/16 C
7325 2 4/13 C
7225 2 4/15 C
7188 1 4/13 C
7384 1 4/12 C
7324 3 4/13 C
7103 1 4/10 C
7415 1 4/13 C
Order
7
Row Distribution Using a NUPI
Order
Number
Customer
Number
Order
Date
Order
Status
PK
NUPI
7325
7324
7415
7103
7225
7384
7402
7188
7202
2
3
1
1
2
1
3
1
2
4/13
4/13
4/13
4/10
4/15
4/12
4/16
4/13
4/09
O
O
C
O
C
C
C
C
C
Order
Customer_Number may be the
referred access column for ORDER
table, thus a good index candidate.
Values for Customer_Number are
non-unique and therefore a NUPI.
Rows with the same PI value
distribute to the same AMP
causing row distribution to
be less uniform or skewed.
7225 2 4/15 C
7325 2 4/13 0
7415 1 4/13 C
7384 1 4/12 C
7324 3 4/13 0
7402 3 4/16 C7103 1 4/10 C
AMP 1 AMP 2 AMP 4
7202 2 4/09 C
7188 1 4/13 C
AMP 3
8
Secondary Indexes
Three general ways to access a table:
 Primary index access (one-AMP access)
 Secondary index access (two-or all-AMP access)
 FullTable Scan (all-AMP access)
A secondary index is an alternate path to the rows of a table.
A table can have from 0 to 32 secondary indexes.
Secondary indexes:
‱ Do not affect table distribution.
‱ Add overhead, both in terms of disk space and maintenance.
‱ May be added or dropped dynamically as needed.
‱ Are chosen to improve table performance.
9
Customer table
Id = 100
USI Value = 56
Table ID Row Hash USI Value
100 602 56
Hashing
Algorithm
PE
CREATE UNIQUE INDEX
(cust) on customer;
SELECT *
FROM customer
WHERE cust = 56;
Create
USI
Access via
USI
- * -
AMP 1 AMP 2 AMP 3 AMP 4
RowID Cust RowID RowID Cust RowID RowID CustRowID RowID Cust RowID
BYNET
AMP 2
Table ID
100
Row Hash
778
Unique Val
7
USI Subtable USI Subtable USI SubtableUSI Subtable
BYNET
AMP 1 AMP 3 AMP 4
74
77
51
27
884, 1
639, 1
915, 9
388, 1
244, 1
505, 1
744, 4
757, 1
84
98
56
49
536, 5
555, 6
778, 7
147, 1
296, 1
135, 1
602, 1
969, 1
31
40
45
95
638, 1
640, 1
471, 1
778, 3
288, 1
339, 1
372, 2
588, 1
175, 1 37 107, 1
489, 1 72 717, 2
838, 1 12 147, 2
919, 1 62 822, 1
Adams
Smith
Rice
White555-4444
111-2222
222-3333
666-5555
31
37
40
84
107, 1
536, 5
638, 1
640, 1
RowIDCustName Phone
NUPI
Base Table
US
I
RowIDCust Name Phone
NUPI
Base Table
US
I
Base Table Base Table
Adams
Smith
Brown
Adams444-6666
666-7777
555-6666
333-9999
72
45
74
98
471, 1
555, 6
717, 2
884, 1
Jones
Black
Young
Smith111-6666
222-8888
444-5555
777-4444
27
49
62
12
147, 1
147, 2
388, 1
822, 1
RowIDCustName Phone
NUPIUS
I
Smith
Marsh
Peters
Jones 777-6666
555-7777
888-2222
555-7777
56
77
51
95
639, 1
778, 3
778, 7
915, 9
RowIDCustName Phone
NUPIUS
I
Unique Secondary Index (USI) Access
10
Non-Unique Secondary Index (NUSI) Access
Table ID
100
Row Hash
567
NUSI Value
‘Adams’
Hashing
Algorithm
Customer table Id
= 100
BYNET
AMP 2
NUSI Value = ‘Adams’
PE
CREATE INDEX (name) on
customer;
SELECT *
FROM customer
WHERE name = ‘Adams’;
Create
NUSI
Access
via NUSI
AMP 1
Brown
Adams
Smith
555, 6
471, 1 717, 2
884, 1
852, 1
567, 2
432, 3
RowID Name RowID
White
Rice
Adams
Smith
107, 1
536, 5
638, 1
640, 1
448, 1
656, 1
567, 3
432, 8
RowID Name RowID
NUSI Subtable NUSI Subtable
Smith
Young
Jones
Black
147, 1
147, 2
338, 1
822, 1
432, 1
770, 1
567, 6
448, 4
RowID Name RowID
NUSI Subtable
Jones
Peters
Smith
Marsh
639, 1
778, 3
778, 7
915, 9
262, 1
396, 1
432, 5
155, 1
RowID Name RowID
NUSI Subtable
AMP 4AMP 3
Adams
Smith
Rice
White 555-4444
111-2222
222-3333
666-5555
31
37
40
84
107, 1
536, 5
638, 1
640, 1
RowIDCust Name Phone
NUPI
Base Table
RowIDCust Name Phone
NUPI
Base Table Base Table Base Table
Adams
Smith
Brown
Adams444-6666
666-7777
555-6666
333-9999
72
45
74
98
471, 1
555, 6
717, 2
884, 1
Jones
Black
Young
Smith 111-6666
222-8888
444-5555
777-4444
27
49
62
12
147, 1
147, 2
388, 1
822, 1
RowIDCust Name Phone
NUPI
Smith
Marsh
Peters
Jones 777-6666
555-7777
888-2222
555-7777
56
77
51
95
639, 1
778, 3
778, 7
915, 9
RowIDCust Name Phone
NUPINUSI NUSI NUSI NUSI
11
Comparison of Primary and Secondary Indexes
Index Feature Primary Secondary
Required? Yes No
Number per Table 1 0-32
Max Number of Columns 16 16
Unique or Non-Unique? Both Both
Affects Row Distribution Yes No
Created/Dropped Dynamically No Yes
Improves Access Yes Yes
Multiple Data Types Yes Yes
Separate Physical Structure None Sub-table
Extra Processing Overhead No Yes
12
Primary Keys and Primary Indexes
Primary Key
Logical concept of data modeling
Teradata doesn’t need to recognize
No limit on column numbers
Documented in data model
(Optional in CREATETABLE)
Must be unique
Uniquely identifies each row
Values should not change
May not be NULL—requires a value
Does not imply an access path
Chosen for logical correctness
Primary Index
Physical mechanism for access and
storage
Each table must have exactly one
16-column limit
Defined in CREATETABLE statement
May be unique or non-unique
Used to place and locate each row
on an AMP
Values may be changed (Del+ Ins)
May be NULL
Defines most efficient access path
Chosen for physical performance
Indexes are conceptually different from keys:
A PK is a relational modeling convention which uniquely identified each row.
A PI is aTeradata convention which determines how the rows are stored and accessed.
A significant percentage of tables may use the same columns for both the PK and PI.
A well-designed database will use a PI that is different from the PK for some tables.
LearnTeradata Online
Contact:
USA: +1 732 325 1626
India: +91 800 811 4040
Mail: info@bigclasses.com
/bigclasses /bigclasses /bigclasses
http://bigclasses.com/teradata-online-training.html
1
4
WatchTeradata DEMOVideo OnYouTube
www.youtube.com/user/bigclassescom

Weitere Àhnliche Inhalte

Was ist angesagt?

DAS RAID NAS SAN
DAS RAID NAS SANDAS RAID NAS SAN
DAS RAID NAS SAN
Ghassen Smida
 

Was ist angesagt? (20)

ACID ORC, Iceberg, and Delta Lake—An Overview of Table Formats for Large Scal...
ACID ORC, Iceberg, and Delta Lake—An Overview of Table Formats for Large Scal...ACID ORC, Iceberg, and Delta Lake—An Overview of Table Formats for Large Scal...
ACID ORC, Iceberg, and Delta Lake—An Overview of Table Formats for Large Scal...
 
Database storage engines
Database storage enginesDatabase storage engines
Database storage engines
 
Presentation of Apache Cassandra
Presentation of Apache Cassandra Presentation of Apache Cassandra
Presentation of Apache Cassandra
 
Mysql security 5.7
Mysql security 5.7 Mysql security 5.7
Mysql security 5.7
 
Build Data Lakes and Analytics on AWS: Patterns & Best Practices
Build Data Lakes and Analytics on AWS: Patterns & Best PracticesBuild Data Lakes and Analytics on AWS: Patterns & Best Practices
Build Data Lakes and Analytics on AWS: Patterns & Best Practices
 
Data Privacy with Apache Spark: Defensive and Offensive Approaches
Data Privacy with Apache Spark: Defensive and Offensive ApproachesData Privacy with Apache Spark: Defensive and Offensive Approaches
Data Privacy with Apache Spark: Defensive and Offensive Approaches
 
Apache Spark AI Use Case in Telco: Network Quality Analysis and Prediction wi...
Apache Spark AI Use Case in Telco: Network Quality Analysis and Prediction wi...Apache Spark AI Use Case in Telco: Network Quality Analysis and Prediction wi...
Apache Spark AI Use Case in Telco: Network Quality Analysis and Prediction wi...
 
Why Use an Oracle Database?
Why Use an Oracle Database?Why Use an Oracle Database?
Why Use an Oracle Database?
 
Row or Columnar Database
Row or Columnar DatabaseRow or Columnar Database
Row or Columnar Database
 
Spark SQL
Spark SQLSpark SQL
Spark SQL
 
No sqlpresentation
No sqlpresentationNo sqlpresentation
No sqlpresentation
 
Data warehouse
Data warehouseData warehouse
Data warehouse
 
Amazon Redshift: Performance Tuning and Optimization
Amazon Redshift: Performance Tuning and OptimizationAmazon Redshift: Performance Tuning and Optimization
Amazon Redshift: Performance Tuning and Optimization
 
Dimensional Modelling
Dimensional ModellingDimensional Modelling
Dimensional Modelling
 
The Chief Data Officer - quotes from data & analytics thought leaders
The Chief Data Officer - quotes from data & analytics thought leadersThe Chief Data Officer - quotes from data & analytics thought leaders
The Chief Data Officer - quotes from data & analytics thought leaders
 
MyRocks Deep Dive
MyRocks Deep DiveMyRocks Deep Dive
MyRocks Deep Dive
 
MySQL Cluster performance best practices
MySQL Cluster performance best practicesMySQL Cluster performance best practices
MySQL Cluster performance best practices
 
DAS RAID NAS SAN
DAS RAID NAS SANDAS RAID NAS SAN
DAS RAID NAS SAN
 
Modern Data Architecture
Modern Data ArchitectureModern Data Architecture
Modern Data Architecture
 
Teradata 13.10
Teradata 13.10Teradata 13.10
Teradata 13.10
 

Andere mochten auch

Andere mochten auch (16)

Teradata introduction
Teradata introductionTeradata introduction
Teradata introduction
 
Teradata Big Data London Seminar
Teradata Big Data London SeminarTeradata Big Data London Seminar
Teradata Big Data London Seminar
 
Teradata sql-tuning-top-10
Teradata sql-tuning-top-10Teradata sql-tuning-top-10
Teradata sql-tuning-top-10
 
Teradata
TeradataTeradata
Teradata
 
How to Use Algorithms to Scale Digital Business
How to Use Algorithms to Scale Digital BusinessHow to Use Algorithms to Scale Digital Business
How to Use Algorithms to Scale Digital Business
 
ABC of Teradata System Performance Analysis
ABC of Teradata System Performance AnalysisABC of Teradata System Performance Analysis
ABC of Teradata System Performance Analysis
 
Teradata - Presentation at Hortonworks Booth - Strata 2014
Teradata - Presentation at Hortonworks Booth - Strata 2014Teradata - Presentation at Hortonworks Booth - Strata 2014
Teradata - Presentation at Hortonworks Booth - Strata 2014
 
Teradata Architecture
Teradata Architecture Teradata Architecture
Teradata Architecture
 
Understanding System Performance
Understanding System PerformanceUnderstanding System Performance
Understanding System Performance
 
Teradata memory management - A balancing act
Teradata memory management  -  A balancing actTeradata memory management  -  A balancing act
Teradata memory management - A balancing act
 
Teradata Training Course Content
Teradata Training Course ContentTeradata Training Course Content
Teradata Training Course Content
 
Teradata - Architecture of Teradata
Teradata - Architecture of TeradataTeradata - Architecture of Teradata
Teradata - Architecture of Teradata
 
Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)
 
Utilities Industry - Smart Analytics
Utilities Industry - Smart AnalyticsUtilities Industry - Smart Analytics
Utilities Industry - Smart Analytics
 
Les08
Les08Les08
Les08
 
DLM knowledge-sharing
DLM knowledge-sharingDLM knowledge-sharing
DLM knowledge-sharing
 

Ähnlich wie Introduction to Teradata And How Teradata Works

Session4_TrackA_Workshop_Tinazzi_Faini.pptx
Session4_TrackA_Workshop_Tinazzi_Faini.pptxSession4_TrackA_Workshop_Tinazzi_Faini.pptx
Session4_TrackA_Workshop_Tinazzi_Faini.pptx
ssuser660bb1
 

Ähnlich wie Introduction to Teradata And How Teradata Works (20)

1.5 PI Access.pdf
1.5 PI Access.pdf1.5 PI Access.pdf
1.5 PI Access.pdf
 
Performance tuning ColumnStore
Performance tuning ColumnStorePerformance tuning ColumnStore
Performance tuning ColumnStore
 
1.6 PI Mechanics.pdf
1.6  PI Mechanics.pdf1.6  PI Mechanics.pdf
1.6 PI Mechanics.pdf
 
2. Data Preprocessing with Numpy and Pandas.pptx
2. Data Preprocessing with Numpy and Pandas.pptx2. Data Preprocessing with Numpy and Pandas.pptx
2. Data Preprocessing with Numpy and Pandas.pptx
 
Basics on SQL queries
Basics on SQL queriesBasics on SQL queries
Basics on SQL queries
 
Indexes overview
Indexes overviewIndexes overview
Indexes overview
 
DB
DBDB
DB
 
Session4_TrackA_Workshop_Tinazzi_Faini.pptx
Session4_TrackA_Workshop_Tinazzi_Faini.pptxSession4_TrackA_Workshop_Tinazzi_Faini.pptx
Session4_TrackA_Workshop_Tinazzi_Faini.pptx
 
Base SAS Statistics Procedures
Base SAS Statistics ProceduresBase SAS Statistics Procedures
Base SAS Statistics Procedures
 
Firebird: cost-based optimization and statistics, by Dmitry Yemanov (in English)
Firebird: cost-based optimization and statistics, by Dmitry Yemanov (in English)Firebird: cost-based optimization and statistics, by Dmitry Yemanov (in English)
Firebird: cost-based optimization and statistics, by Dmitry Yemanov (in English)
 
Improve speed & performance of informix 11.xx part 1
Improve speed & performance of informix 11.xx   part 1Improve speed & performance of informix 11.xx   part 1
Improve speed & performance of informix 11.xx part 1
 
Presentation top tips for getting optimal sql execution
Presentation    top tips for getting optimal sql executionPresentation    top tips for getting optimal sql execution
Presentation top tips for getting optimal sql execution
 
Teradata a z
Teradata a zTeradata a z
Teradata a z
 
SQL Optimization With Trace Data And Dbms Xplan V6
SQL Optimization With Trace Data And Dbms Xplan V6SQL Optimization With Trace Data And Dbms Xplan V6
SQL Optimization With Trace Data And Dbms Xplan V6
 
Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsTop 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tips
 
San diegophp
San diegophpSan diegophp
San diegophp
 
Presentation on Elementary data structures
Presentation on Elementary data structuresPresentation on Elementary data structures
Presentation on Elementary data structures
 
Quant trading with artificial intelligence
Quant trading with artificial intelligenceQuant trading with artificial intelligence
Quant trading with artificial intelligence
 
Goldilocks and the Three MySQL Queries
Goldilocks and the Three MySQL QueriesGoldilocks and the Three MySQL Queries
Goldilocks and the Three MySQL Queries
 
AWS July Webinar Series: Amazon Redshift Optimizing Performance
AWS July Webinar Series: Amazon Redshift Optimizing PerformanceAWS July Webinar Series: Amazon Redshift Optimizing Performance
AWS July Webinar Series: Amazon Redshift Optimizing Performance
 

Mehr von BigClasses Com

Mehr von BigClasses Com (20)

SAP BW Powered by SAP HANA
SAP BW Powered by  SAP HANASAP BW Powered by  SAP HANA
SAP BW Powered by SAP HANA
 
Why Java Professionals Should Learn Hadoop
Why Java Professionals Should Learn HadoopWhy Java Professionals Should Learn Hadoop
Why Java Professionals Should Learn Hadoop
 
Hadoop course content
Hadoop course contentHadoop course content
Hadoop course content
 
Why Hadoop and benefits
Why Hadoop and benefits Why Hadoop and benefits
Why Hadoop and benefits
 
Informatica Powercenter Architecture
Informatica Powercenter ArchitectureInformatica Powercenter Architecture
Informatica Powercenter Architecture
 
Microstrategy Mobile
Microstrategy MobileMicrostrategy Mobile
Microstrategy Mobile
 
Microstrategy Administration
Microstrategy AdministrationMicrostrategy Administration
Microstrategy Administration
 
Why Informatica
Why InformaticaWhy Informatica
Why Informatica
 
Microstrategy Architect and Developer
Microstrategy Architect and DeveloperMicrostrategy Architect and Developer
Microstrategy Architect and Developer
 
Microstrategy Architecture
Microstrategy ArchitectureMicrostrategy Architecture
Microstrategy Architecture
 
Informatica Products and Usage
Informatica Products  and UsageInformatica Products  and Usage
Informatica Products and Usage
 
What is Informatica Powercenter
What is Informatica PowercenterWhat is Informatica Powercenter
What is Informatica Powercenter
 
Where is microstrategy used and job trends
Where is microstrategy used and job trendsWhere is microstrategy used and job trends
Where is microstrategy used and job trends
 
Why MicroStrategy
Why MicroStrategyWhy MicroStrategy
Why MicroStrategy
 
SAP Business Objects BI Architecture
SAP Business Objects BI ArchitectureSAP Business Objects BI Architecture
SAP Business Objects BI Architecture
 
SAP Business Objects Administration
SAP Business Objects Administration SAP Business Objects Administration
SAP Business Objects Administration
 
SAP BusinessObjects BI LaunchPad
SAP BusinessObjects BI LaunchPadSAP BusinessObjects BI LaunchPad
SAP BusinessObjects BI LaunchPad
 
SAP BusinessObjects Dashboards
SAP BusinessObjects DashboardsSAP BusinessObjects Dashboards
SAP BusinessObjects Dashboards
 
SAP BusinessObjects Crystal Reports
SAP BusinessObjects Crystal ReportsSAP BusinessObjects Crystal Reports
SAP BusinessObjects Crystal Reports
 
SAP BusinessObjects Web Intelligence Report
SAP BusinessObjects Web Intelligence ReportSAP BusinessObjects Web Intelligence Report
SAP BusinessObjects Web Intelligence Report
 

KĂŒrzlich hochgeladen

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

KĂŒrzlich hochgeladen (20)

Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 

Introduction to Teradata And How Teradata Works

  • 3. 3 How DoesTeradata Store Rows? ï‚Ą Teradata uses hashing algorithm to randomly and evenly distribute data across all AMPs. ï‚Ą The rows of every table are distributed among all AMPs - and ideally will be evenly distributed among all AMPs. ï‚Ą Each AMP is responsible for a subset of the rows of each table. ï‚Ą Evenly distributed tables result in evenly distributed workloads. ï‚Ą The data is not placed in any particular order The benefits of unordered data include: ï‚Ą No maintenance needed to preserve order, and ï‚Ą It is independent of any query being submitted. The benefits of automatic data placement include: ï‚Ą Distribution is the same regardless of data volume ï‚Ą Distribution is based on row content, not data demographics
  • 4. 4 Primary Indexes  The mechanism used to assign a row to an AMP  A table must have a Primary Index  The Primary Index cannot be changed UPI  If the index choice of column(s) is unique, we call this a UPI (Unique Primary Index).  A UPI choice will result in even distribution of the rows of the table across all AMPs. NUPI  If the index choice of column(s) isn’t unique, we call this a NUPI (Non- Unique Primary Index).  A NUPI choice will result in even distribution of the rows of the table proportional to the degree of uniqueness of the index. UPI’s guarantee even data distribution and eliminate duplicate row checking. Why would you choose an Index that is different from the Primary Key? ‱ Join performance ‱ Known access paths
  • 5. 5 Data Storage based on Primary Index  The value of the Primary Index for a specific row determines its AMP assignment.  This is done using the hashing algorithm. PIValue AMP AMP AMP PE Row assignment Row access Hashing algorithm Accessing the row by its Primary Index value is:  Always a one-AMP operation  The most efficient way to access a row
  • 6. 6 Row Distribution Using a UPI Order Number Customer Number Order Date Order Status PK UPI 7325 7324 7415 7103 7225 7384 7402 7188 7202 2 3 1 1 2 1 3 1 2 4/13 4/13 4/13 4/10 4/15 4/12 4/16 4/13 4/09 O O C O C C C C C The PK column(s) will often be used as a UPI. PI values for Order_Number are known to be unique (it’s a PK). Teradata will distribute different index values evenly across AMPs. Resulting row distribution among AMPs is uniform. AMP 1 AMP 2 AMP 3 AMP 4 7202 2 4/09 C 7402 3 4/16 C 7325 2 4/13 C 7225 2 4/15 C 7188 1 4/13 C 7384 1 4/12 C 7324 3 4/13 C 7103 1 4/10 C 7415 1 4/13 C Order
  • 7. 7 Row Distribution Using a NUPI Order Number Customer Number Order Date Order Status PK NUPI 7325 7324 7415 7103 7225 7384 7402 7188 7202 2 3 1 1 2 1 3 1 2 4/13 4/13 4/13 4/10 4/15 4/12 4/16 4/13 4/09 O O C O C C C C C Order Customer_Number may be the referred access column for ORDER table, thus a good index candidate. Values for Customer_Number are non-unique and therefore a NUPI. Rows with the same PI value distribute to the same AMP causing row distribution to be less uniform or skewed. 7225 2 4/15 C 7325 2 4/13 0 7415 1 4/13 C 7384 1 4/12 C 7324 3 4/13 0 7402 3 4/16 C7103 1 4/10 C AMP 1 AMP 2 AMP 4 7202 2 4/09 C 7188 1 4/13 C AMP 3
  • 8. 8 Secondary Indexes Three general ways to access a table:  Primary index access (one-AMP access)  Secondary index access (two-or all-AMP access)  FullTable Scan (all-AMP access) A secondary index is an alternate path to the rows of a table. A table can have from 0 to 32 secondary indexes. Secondary indexes: ‱ Do not affect table distribution. ‱ Add overhead, both in terms of disk space and maintenance. ‱ May be added or dropped dynamically as needed. ‱ Are chosen to improve table performance.
  • 9. 9 Customer table Id = 100 USI Value = 56 Table ID Row Hash USI Value 100 602 56 Hashing Algorithm PE CREATE UNIQUE INDEX (cust) on customer; SELECT * FROM customer WHERE cust = 56; Create USI Access via USI - * - AMP 1 AMP 2 AMP 3 AMP 4 RowID Cust RowID RowID Cust RowID RowID CustRowID RowID Cust RowID BYNET AMP 2 Table ID 100 Row Hash 778 Unique Val 7 USI Subtable USI Subtable USI SubtableUSI Subtable BYNET AMP 1 AMP 3 AMP 4 74 77 51 27 884, 1 639, 1 915, 9 388, 1 244, 1 505, 1 744, 4 757, 1 84 98 56 49 536, 5 555, 6 778, 7 147, 1 296, 1 135, 1 602, 1 969, 1 31 40 45 95 638, 1 640, 1 471, 1 778, 3 288, 1 339, 1 372, 2 588, 1 175, 1 37 107, 1 489, 1 72 717, 2 838, 1 12 147, 2 919, 1 62 822, 1 Adams Smith Rice White555-4444 111-2222 222-3333 666-5555 31 37 40 84 107, 1 536, 5 638, 1 640, 1 RowIDCustName Phone NUPI Base Table US I RowIDCust Name Phone NUPI Base Table US I Base Table Base Table Adams Smith Brown Adams444-6666 666-7777 555-6666 333-9999 72 45 74 98 471, 1 555, 6 717, 2 884, 1 Jones Black Young Smith111-6666 222-8888 444-5555 777-4444 27 49 62 12 147, 1 147, 2 388, 1 822, 1 RowIDCustName Phone NUPIUS I Smith Marsh Peters Jones 777-6666 555-7777 888-2222 555-7777 56 77 51 95 639, 1 778, 3 778, 7 915, 9 RowIDCustName Phone NUPIUS I Unique Secondary Index (USI) Access
  • 10. 10 Non-Unique Secondary Index (NUSI) Access Table ID 100 Row Hash 567 NUSI Value ‘Adams’ Hashing Algorithm Customer table Id = 100 BYNET AMP 2 NUSI Value = ‘Adams’ PE CREATE INDEX (name) on customer; SELECT * FROM customer WHERE name = ‘Adams’; Create NUSI Access via NUSI AMP 1 Brown Adams Smith 555, 6 471, 1 717, 2 884, 1 852, 1 567, 2 432, 3 RowID Name RowID White Rice Adams Smith 107, 1 536, 5 638, 1 640, 1 448, 1 656, 1 567, 3 432, 8 RowID Name RowID NUSI Subtable NUSI Subtable Smith Young Jones Black 147, 1 147, 2 338, 1 822, 1 432, 1 770, 1 567, 6 448, 4 RowID Name RowID NUSI Subtable Jones Peters Smith Marsh 639, 1 778, 3 778, 7 915, 9 262, 1 396, 1 432, 5 155, 1 RowID Name RowID NUSI Subtable AMP 4AMP 3 Adams Smith Rice White 555-4444 111-2222 222-3333 666-5555 31 37 40 84 107, 1 536, 5 638, 1 640, 1 RowIDCust Name Phone NUPI Base Table RowIDCust Name Phone NUPI Base Table Base Table Base Table Adams Smith Brown Adams444-6666 666-7777 555-6666 333-9999 72 45 74 98 471, 1 555, 6 717, 2 884, 1 Jones Black Young Smith 111-6666 222-8888 444-5555 777-4444 27 49 62 12 147, 1 147, 2 388, 1 822, 1 RowIDCust Name Phone NUPI Smith Marsh Peters Jones 777-6666 555-7777 888-2222 555-7777 56 77 51 95 639, 1 778, 3 778, 7 915, 9 RowIDCust Name Phone NUPINUSI NUSI NUSI NUSI
  • 11. 11 Comparison of Primary and Secondary Indexes Index Feature Primary Secondary Required? Yes No Number per Table 1 0-32 Max Number of Columns 16 16 Unique or Non-Unique? Both Both Affects Row Distribution Yes No Created/Dropped Dynamically No Yes Improves Access Yes Yes Multiple Data Types Yes Yes Separate Physical Structure None Sub-table Extra Processing Overhead No Yes
  • 12. 12 Primary Keys and Primary Indexes Primary Key Logical concept of data modeling Teradata doesn’t need to recognize No limit on column numbers Documented in data model (Optional in CREATETABLE) Must be unique Uniquely identifies each row Values should not change May not be NULL—requires a value Does not imply an access path Chosen for logical correctness Primary Index Physical mechanism for access and storage Each table must have exactly one 16-column limit Defined in CREATETABLE statement May be unique or non-unique Used to place and locate each row on an AMP Values may be changed (Del+ Ins) May be NULL Defines most efficient access path Chosen for physical performance Indexes are conceptually different from keys: A PK is a relational modeling convention which uniquely identified each row. A PI is aTeradata convention which determines how the rows are stored and accessed. A significant percentage of tables may use the same columns for both the PK and PI. A well-designed database will use a PI that is different from the PK for some tables.
  • 13. LearnTeradata Online Contact: USA: +1 732 325 1626 India: +91 800 811 4040 Mail: info@bigclasses.com /bigclasses /bigclasses /bigclasses http://bigclasses.com/teradata-online-training.html