SlideShare a Scribd company logo
1 of 18
Teradata Basics 
After completing this module, you will be able to: 
· List and describe the major components of the Teradata 
architecture. 
· Describe how the components interact to manage incoming 
and outgoing data. 
· List 5 types of Teradata database objects.
Major Components of Teradata 
Answer Set 
Response 
SQL 
Request 
Parsing Engine 
Message Passing Layer 
AMPs store and retrieve rows to and from disk. 
Parsing Engines (PE) 
• Manage sessions for users 
• Parse, optimize, and send your request to 
the AMPs as execution steps 
• Returns answer set response back to client 
Message Passing Layer (MPL) 
• Allows PEs and AMPs to communicate with 
each other 
Access Module Processors (AMP) 
• Owns and manages its storage 
• Performs the steps sent by the PEs 
Virtual Disks (Vdisk) 
• Space owned by the AMP and is used to 
hold user data (rows within tables). 
• Maps to physical space in a disk array. 
… Parsing Engine 
… 
… 
AMP 
Vdisk 
AMP 
Vdisk 
AMP 
Vdisk 
AMP 
Vdisk
Teradata Storage Architecture 
The Parsing Engine dispatches 
request to insert a row. 
The Message Passing Layer 
insures that a row gets to the 
appropriate AMP (Access Module 
Processor). 
The AMP stores the row on its 
associated (logical) disk. 
An AMP manages a logical or 
virtual disk which is mapped to 
multiple physical disks in a disk 
array. 
Teradata 
Parsing 
Engine(s) 
Message Passing Layer 
AMP 1 AMP 2 AMP 3 AMP 4 
2 54 
18 
41 
12 
90 
75 
80 
32 
6 
67 
25 
Records From Client (in random sequence) 
2 32 67 12 90 6 54 75 18 25 80 41
Teradata Retrieval Architecture 
The Parsing Engine dispatches a 
request to retrieve one or more 
rows. 
The Message Passing Layer 
insures that the appropriate 
AMP(s) are activated. 
The AMP(s) locate and retrieve 
desired row(s) in parallel access. 
Message Passing Layer returns the 
retrieved rows to PE. 
The PE returns row(s) to 
requesting client application. 
Teradata 
Parsing 
Engine(s) 
Message Passing Layer 
AMP 1 AMP 2 AMP 3 AMP 4 
2 54 
18 
41 
12 
90 
75 
80 
32 
6 
67 
25 
Rows retrieved from table 
2 32 67 12 90 6 54 75 18 25 80 41
Multiple Tables on Multiple AMPs 
EMPLOYEE Table DEPARTMENT Table JOB Table 
EMPLOYEE Rows 
DEPARTMENT Rows 
JOB Rows 
Parsing Engine 
Message Passing Layer 
Row from each table will usually 
be stored on each AMP. 
Each AMP may have rows from all 
tables. 
Ideally, each AMP will hold roughly 
the same amount of data. 
AMP 1 AMP 2 AMP 3 AMP 4 
EMPLOYEE Rows 
DEPARTMENT Rows 
JOB Rows 
EMPLOYEE Rows 
DEPARTMENT Rows 
JOB Rows 
EMPLOYEE Rows 
DEPARTMENT Rows 
JOB Rows
Linear Growth and Expandability 
Parsing 
Engine 
AMP 
SESSIONS 
PARALLEL PROCESSING 
DATA 
Disk 
• Teradata is a linearly 
expandable RDBMS. 
• Components may be added as 
requirements grow. 
• Linear scalability allows for 
increased workload without 
decreased throughput. 
• Performance impact of adding 
components is shown below. 
USERS AMPs DATA Performance 
Same Same Same Same 
Double Double Same Same 
Same Double Double Same 
Same Double Same Double 
Parsing 
Engine 
Parsing 
Engine 
Disk 
Disk 
AMP 
AMP
Teradata Objects 
Examples of objects within a Teradata database or user include: 
Tables – rows and columns of data 
Views – predefined subsets of existing tables 
Macros – predefined, stored SQL statements 
Triggers – SQL statements associated with a table 
Stored Procedures – program stored within Teradata 
User-Defined Function – function (C program) to provide additional SQL functionality 
Join and Hash Indexes – separate index structures stored as objects within a database 
Permanent Journals – table used to store before and/or after images for recovery 
DATABASE or USER can have a mix 
of various objects. 
* - require Permanent Space 
These objects are created, 
maintained, and deleted using SQL. 
Object definitions are stored in the 
DD/D. 
TABLE 1 * TABLE 2 * TABLE 3 * 
VIEW 1 VIEW 2 
MACRO 1 
TRIGGER 1 
Stored Procedure 1 * 
Join/Hash Index 1 * 
Permanent Journal * 
UDF 1 * 
VIEW 3 
These aren't directly accessed by users.
The Data Dictionary Directory (DD/D) 
The DD/D ... 
– is an integrated set of system tables 
– contains definitions of and information about all objects in the system 
– is entirely maintained by the Teradata Database 
– is “data about the data” or “metadata” 
– is distributed across all AMPs like all tables 
– may be queried by administrators or support staff 
– is normally accessed via Teradata supplied views 
Examples of DD/D views: 
DBC.TablesV – information about all tables 
DBC.UsersV – information about all users 
DBC.AllRightsV – information about access rights 
DBC.AllSpaceV – information about space utilization
Structured Query Language (SQL) 
SQL is a query language for Relational Database Systems and is used to access Teradata. 
– A fourth-generation language 
– A set-oriented language 
– A non-procedural language (e.g., doesn’t have IF, DO, FOR NEXT, etc. ) 
SQL consists of: 
Data Definition Language (DDL) 
– Defines database structures (tables, users, views, macros, triggers, etc.) 
CREATE DROP ALTER 
Data Manipulation Language (DML) 
– Manipulates rows and data values 
SELECT INSERT UPDATE DELETE 
Data Control Language (DCL) 
– Grants and revokes access rights 
GRANT REVOKE 
Teradata SQL also includes Teradata Extensions to SQL 
HELP SHOW EXPLAIN CREATE MACRO
CREATE TABLE – Example of DDL 
CREATE TABLE Employee 
(employee_number INTEGER NOT NULL 
,manager_emp_number INTEGER COMPRESS 
,dept_number INTEGER COMPRESS 
,job_code INTEGER COMPRESS 
,last_name CHAR(20) NOT NULL 
,first_name VARCHAR (20) 
,hire_date DATE FORMAT 'YYYY-MM-DD' 
,birth_date DATE FORMAT 'YYYY-MM-DD' 
,salary_amount DECIMAL (10,2) COMPRESS 0 
) 
UNIQUE PRIMARY INDEX (employee_number) 
INDEX (dept_number); 
Other DDL Examples 
CREATE INDEX (job_code) ON Employee ; 
DROP INDEX (job_code) ON Employee ; 
DROP TABLE Employee ;
Views 
Views are pre-defined filters of existing tables consisting of specified columns 
and/or rows from the table(s). 
A single table view: 
– is a window into an underlying table 
– allows users to read and update a subset of the underlying table 
– has no data of its own 
EMPLOYEE (Table) 
MANAGER 
EMPLOYEE EMP DEPT JOB LAST FIRST HIRE BIRTH SALARY 
NUMBER NUMBER NUMBER CODE NAME NAME DATE DATE AMOUNT 
PK FK FK FK 
1006 1019 301 312101 Stein John 861015 631015 3945000 
1008 1019 301 312102 Kanieski Carol 870201 680517 3925000 
1005 0801 403 431100 Ryan Loretta 861015 650910 4120000 
1004 1003 401 412101 Johnson Darlene 861015 560423 4630000 
1007 1005 403 432101 Villegas Arnando 870102 470131 5970000 
1003 0801 401 411100 Trader James 860731 570619 4785000 
Emp403_v (View) 
EMP NO DEPT NO LAST NAME FIRST NAME HIRE DATE 
1005 403 Villegas Arnando 870102 
801 403 Ryan Loretta 861015
Multi-Table Views 
A multi-table view allows users to access data from multiple tables as if it were in a single 
table. Multi-table views (i.e., join views) are used for reading only, not updating. 
EMPLOYEE (Table) 
MANAGER 
EMPLOYEE EMP DEPT JOB LAST FIRST 
NUMBER NUMBER NUMBER CODE NAME NAME 
PK FK FK FK 
1006 1019 301 312101 Stein John 
1008 1019 301 312102 Kanieski Carol 
1005 0801 403 431100 Ryan Loretta 
1004 1003 401 412101 Johnson Darlene 
1007 1005 403 432101 Villegas Arnando 
1003 0801 401 411100 Trader James 
MANAGER 
DEPARTMENT (Table) 
DEPT DEPARTMENT BUDGET EMP 
NUMBER NAME AMOUNT NUMBER 
PK FK 
501 Marketing Sales 80050000 1017 
301 Research & Development 46560000 1019 
302 Product Planning 22600000 1016 
403 Education 93200000 1005 
402 Software Support 30800000 1011 
401 Customer Support 98230000 1003 
EmpDept_v (View) 
Last_Name Department_Name 
Stein Research & Development 
Kanieski Research & Development 
Ryan Education 
Johnson Customer Support 
Villegas Education 
Trader Customer Support 
Joined Together 
Example of SQL to create a join view: 
CREATE VIEW EmpDept_v AS 
SELECT Last_Name 
,Department_Name 
FROM Employee E 
INNER JOIN Department D 
ON E.dept_number = D.dept_number;
Macros 
A MACRO is a predefined set of SQL statements which is logically stored in a database. 
Macros may be created for frequently occurring queries of sets of operations. 
Macros have many features and benefits: 
• Simplify end-user access 
• Control which operations may be performed by users 
• May accept user-provided parameter values 
• Are stored in the Teradata Database, thus available to all clients 
• Reduces query size, thus reduces LAN/channel traffic 
• Are optimized at execution time 
• May contain multiple SQL statements 
To create a macro: 
CREATE MACRO Customer_List AS (SELECT customer_name FROM Customer;); 
To execute a macro: 
EXEC Customer_List; 
To replace a macro: 
REPLACE MACRO Customer_List AS 
(SELECT customer_name, customer_number FROM Customer;);
HELP Command 
Databases and Users: 
HELP DATABASE Customer_Service; 
HELP USER Dave_Jones; 
Tables, Views, Macros, etc.: 
HELP TABLE Employee; 
HELP VIEW Emp_v 
HELP MACRO Payroll_3; 
HELP COLUMN Employee.*; 
Employee.last_name; 
HELP INDEX Employee; 
HELP TRIGGER Raise_Trigger; 
HELP STATISTICS Employee; 
HELP CONSTRAINT Employee.over_21; 
HELP JOIN INDEX Cust_Order_JI; 
HELP SESSION; 
This is not an inclusive list of HELP 
commands. 
Example: 
HELP DATABASE Customer_Service; 
*** Help information returned. 15 rows. 
*** Total elapsed time was 1 second. 
Table/View/Macro name Kind Comment 
Contact T ? 
Customer T ? 
Cust_Comp_Orders V ? 
Cust_Order_JI I ? 
Department T ? 
: : : 
Orders T ? 
Orders_Temp O ? 
Orders_HI N ? 
Raise_Trigger G ? 
Set_Ansidate_on M ?
SHOW Command 
SHOW commands display how an object was created. Examples include: 
Command Returns statement 
SHOW TABLE table_name; CREATE TABLE statement … 
SHOW VIEW view_name; CREATE VIEW ... 
SHOW MACRO macro_name; CREATE MACRO ... 
SHOW TRIGGER trigger_name; CREATE TRIGGER … 
SHOW PROCEDURE procedure_name; CREATE PROCEDURE … 
SHOW JOIN INDEX join_index_name; CREATE JOIN INDEX … 
SHOW TABLE Employee; 
CREATE SET TABLE PD.Employee, FALLBACK, 
NO BEFORE JOURNAL, 
NO AFTER JOURNAL, 
CHECKSUM = DEFAULT, 
DEFAULT MERGEBLOCKRATIO 
( 
Employee_Number INTEGER NOT NULL, 
Emp_Mgr_Number INTEGER COMPRESS, 
Dept_Number INTEGER COMPRESS, 
Job_Code INTEGER COMPRESS, 
Last_Name CHAR(20) CHARACTER SET LATIN NOT CASESPECIFIC, 
First_Name VARCHAR(20) CHARACTER SET LATIN NOT CASESPECIFIC, 
Salary_Amount DECIMAL(10,2) COMPRESS 0) 
UNIQUE PRIMARY INDEX ( Employee_Number ) 
INDEX ( Dept_Number );
EXPLAIN Facility 
The EXPLAIN modifier in front of any SQL statement generates an English translation of 
the Parser’s plan. 
The request is fully parsed and optimized, but not actually executed. 
EXPLAIN returns: 
• Text showing how a statement will be processed (a plan) 
• An estimate of how many rows will be involved 
• A relative cost of the request (in units of time) 
This information is useful for: 
• predicting row counts 
• predicting performance 
• testing queries before production 
• analyzing various approaches to a problem 
EXPLAIN SELECT * FROM Employee WHERE Dept_Number = 1018; 
: 
3) We do an all-AMPs RETRIEVE step from PD.Employee by way of an all-rows scan with a condition of 
("PD.Employee.Dept_Number = 1018") into Spool 1 (group_amps), which is built locally on the AMPs. 
The size of Spool 1 is estimated with high confidence to be 10 rows (730 bytes). The estimated time for 
this step is 0.14 seconds. 
4) Finally, we send out an END TRANSACTION step to all AMPs involved in processing the request. 
-> The contents of Spool 1 are sent back to the user as the result of statement 1. The total estimated time is 
0.14 seconds.
Summary 
The major components of the Teradata Database are: 
Parsing Engines (PE) 
• Manage sessions for users 
• Parse, optimize, and send your request to the AMPs as execution steps 
• Returns answer set response back to client 
Message Passing Layer (MPL) 
• Allows PEs and AMPs to communicate with each other 
Access Module Processors (AMP) 
• Owns and manages its storage 
• Performs the steps sent by the PEs 
Virtual Disks (Vdisk) 
• Space owned by the AMP and is used to hold user data (rows within tables). 
• Maps to physical space in a disk array.
Design and Developed by: 
Noor Alam, 
DW Architect & Project Manager, BI Solutions 
Data edge limited 
Mobile: 8801841320998 
Email: alambd@gmail.com 
Skype: alam.ict

More Related Content

What's hot

DATASTAGE AND QUALITY STAGE 9.1 ONLINE TRAINING
DATASTAGE AND QUALITY STAGE 9.1 ONLINE TRAININGDATASTAGE AND QUALITY STAGE 9.1 ONLINE TRAINING
DATASTAGE AND QUALITY STAGE 9.1 ONLINE TRAININGDatawarehouse Trainings
 
Data modeling star schema
Data modeling star schemaData modeling star schema
Data modeling star schemaSayed Ahmed
 
Oracle architecture with details-yogiji creations
Oracle architecture with details-yogiji creationsOracle architecture with details-yogiji creations
Oracle architecture with details-yogiji creationsYogiji Creations
 
Relational databases vs Non-relational databases
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databasesJames Serra
 
Tableau - Learning Objectives for Data, Graphs, Filters, Dashboards and Advan...
Tableau - Learning Objectives for Data, Graphs, Filters, Dashboards and Advan...Tableau - Learning Objectives for Data, Graphs, Filters, Dashboards and Advan...
Tableau - Learning Objectives for Data, Graphs, Filters, Dashboards and Advan...Srinath Reddy
 
Introduction To Data Vault - DAMA Oregon 2012
Introduction To Data Vault - DAMA Oregon 2012Introduction To Data Vault - DAMA Oregon 2012
Introduction To Data Vault - DAMA Oregon 2012Empowered Holdings, LLC
 
Data Warehousing Trends, Best Practices, and Future Outlook
Data Warehousing Trends, Best Practices, and Future OutlookData Warehousing Trends, Best Practices, and Future Outlook
Data Warehousing Trends, Best Practices, and Future OutlookJames Serra
 
Oracle Architecture
Oracle ArchitectureOracle Architecture
Oracle ArchitectureNeeraj Singh
 
Introduction to Oracle Database
Introduction to Oracle DatabaseIntroduction to Oracle Database
Introduction to Oracle Databasepuja_dhar
 
Multidimensional schema
Multidimensional schemaMultidimensional schema
Multidimensional schemaChaand Chopra
 
SAP Data Services
SAP Data ServicesSAP Data Services
SAP Data ServicesGeetika
 
Data Vault Vs Data Lake
Data Vault Vs Data LakeData Vault Vs Data Lake
Data Vault Vs Data LakeCalum Miller
 
Is the traditional data warehouse dead?
Is the traditional data warehouse dead?Is the traditional data warehouse dead?
Is the traditional data warehouse dead?James Serra
 

What's hot (20)

DATASTAGE AND QUALITY STAGE 9.1 ONLINE TRAINING
DATASTAGE AND QUALITY STAGE 9.1 ONLINE TRAININGDATASTAGE AND QUALITY STAGE 9.1 ONLINE TRAINING
DATASTAGE AND QUALITY STAGE 9.1 ONLINE TRAINING
 
Data warehouse
Data warehouseData warehouse
Data warehouse
 
Data modeling star schema
Data modeling star schemaData modeling star schema
Data modeling star schema
 
Oracle architecture with details-yogiji creations
Oracle architecture with details-yogiji creationsOracle architecture with details-yogiji creations
Oracle architecture with details-yogiji creations
 
Data warehouse
Data warehouse Data warehouse
Data warehouse
 
Relational databases vs Non-relational databases
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databases
 
Tableau - Learning Objectives for Data, Graphs, Filters, Dashboards and Advan...
Tableau - Learning Objectives for Data, Graphs, Filters, Dashboards and Advan...Tableau - Learning Objectives for Data, Graphs, Filters, Dashboards and Advan...
Tableau - Learning Objectives for Data, Graphs, Filters, Dashboards and Advan...
 
Introduction To Data Vault - DAMA Oregon 2012
Introduction To Data Vault - DAMA Oregon 2012Introduction To Data Vault - DAMA Oregon 2012
Introduction To Data Vault - DAMA Oregon 2012
 
Data Warehousing Trends, Best Practices, and Future Outlook
Data Warehousing Trends, Best Practices, and Future OutlookData Warehousing Trends, Best Practices, and Future Outlook
Data Warehousing Trends, Best Practices, and Future Outlook
 
Data Warehouse 101
Data Warehouse 101Data Warehouse 101
Data Warehouse 101
 
MS-SQL SERVER ARCHITECTURE
MS-SQL SERVER ARCHITECTUREMS-SQL SERVER ARCHITECTURE
MS-SQL SERVER ARCHITECTURE
 
Oracle Architecture
Oracle ArchitectureOracle Architecture
Oracle Architecture
 
Oracle Database Vault
Oracle Database VaultOracle Database Vault
Oracle Database Vault
 
Introduction to Oracle Database
Introduction to Oracle DatabaseIntroduction to Oracle Database
Introduction to Oracle Database
 
Multidimensional schema
Multidimensional schemaMultidimensional schema
Multidimensional schema
 
SAP Data Services
SAP Data ServicesSAP Data Services
SAP Data Services
 
Data Vault Vs Data Lake
Data Vault Vs Data LakeData Vault Vs Data Lake
Data Vault Vs Data Lake
 
Sql server basics
Sql server basicsSql server basics
Sql server basics
 
Is the traditional data warehouse dead?
Is the traditional data warehouse dead?Is the traditional data warehouse dead?
Is the traditional data warehouse dead?
 
Data warehouse
Data warehouseData warehouse
Data warehouse
 

Similar to Module 02 teradata basics (20)

Module02
Module02Module02
Module02
 
7. SQL.pptx
7. SQL.pptx7. SQL.pptx
7. SQL.pptx
 
MDI Training DB2 Course
MDI Training DB2 CourseMDI Training DB2 Course
MDI Training DB2 Course
 
Sql intro & ddl 1
Sql intro & ddl 1Sql intro & ddl 1
Sql intro & ddl 1
 
Sql intro & ddl 1
Sql intro & ddl 1Sql intro & ddl 1
Sql intro & ddl 1
 
MIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome MeasuresMIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome Measures
 
Database COMPLETE
Database COMPLETEDatabase COMPLETE
Database COMPLETE
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
PPT SQL CLASS.pptx
PPT SQL CLASS.pptxPPT SQL CLASS.pptx
PPT SQL CLASS.pptx
 
My sql.ppt
My sql.pptMy sql.ppt
My sql.ppt
 
lovely
lovelylovely
lovely
 
4.Database Management System.pdf
4.Database Management System.pdf4.Database Management System.pdf
4.Database Management System.pdf
 
[PHPUGPH] PHP Roadshow - MySQL
[PHPUGPH] PHP Roadshow - MySQL[PHPUGPH] PHP Roadshow - MySQL
[PHPUGPH] PHP Roadshow - MySQL
 
Less08 Schema
Less08 SchemaLess08 Schema
Less08 Schema
 
Mysql
MysqlMysql
Mysql
 
Prog1 chap1 and chap 2
Prog1 chap1 and chap 2Prog1 chap1 and chap 2
Prog1 chap1 and chap 2
 
SQL Server 2008 Performance Enhancements
SQL Server 2008 Performance EnhancementsSQL Server 2008 Performance Enhancements
SQL Server 2008 Performance Enhancements
 
Rdbms day3
Rdbms day3Rdbms day3
Rdbms day3
 

Recently uploaded

Switzerland Constitution 2002.pdf.........
Switzerland Constitution 2002.pdf.........Switzerland Constitution 2002.pdf.........
Switzerland Constitution 2002.pdf.........EfruzAsilolu
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...Health
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...nirzagarg
 
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowgargpaaro
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabiaahmedjiabur940
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxchadhar227
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRajesh Mondal
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制vexqp
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteedamy56318795
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...gajnagarg
 
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制vexqp
 
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...gajnagarg
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareGraham Ware
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...nirzagarg
 
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格q6pzkpark
 
PLE-statistics document for primary schs
PLE-statistics document for primary schsPLE-statistics document for primary schs
PLE-statistics document for primary schscnajjemba
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...Bertram Ludäscher
 

Recently uploaded (20)

Switzerland Constitution 2002.pdf.........
Switzerland Constitution 2002.pdf.........Switzerland Constitution 2002.pdf.........
Switzerland Constitution 2002.pdf.........
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
 
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for Research
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
怎样办理纽约州立大学宾汉姆顿分校毕业证(SUNY-Bin毕业证书)成绩单学校原版复制
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
 
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
 
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
 
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
 
PLE-statistics document for primary schs
PLE-statistics document for primary schsPLE-statistics document for primary schs
PLE-statistics document for primary schs
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
 
Cytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
Cytotec in Jeddah+966572737505) get unwanted pregnancy kit RiyadhCytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
Cytotec in Jeddah+966572737505) get unwanted pregnancy kit Riyadh
 

Module 02 teradata basics

  • 1. Teradata Basics After completing this module, you will be able to: · List and describe the major components of the Teradata architecture. · Describe how the components interact to manage incoming and outgoing data. · List 5 types of Teradata database objects.
  • 2. Major Components of Teradata Answer Set Response SQL Request Parsing Engine Message Passing Layer AMPs store and retrieve rows to and from disk. Parsing Engines (PE) • Manage sessions for users • Parse, optimize, and send your request to the AMPs as execution steps • Returns answer set response back to client Message Passing Layer (MPL) • Allows PEs and AMPs to communicate with each other Access Module Processors (AMP) • Owns and manages its storage • Performs the steps sent by the PEs Virtual Disks (Vdisk) • Space owned by the AMP and is used to hold user data (rows within tables). • Maps to physical space in a disk array. … Parsing Engine … … AMP Vdisk AMP Vdisk AMP Vdisk AMP Vdisk
  • 3. Teradata Storage Architecture The Parsing Engine dispatches request to insert a row. The Message Passing Layer insures that a row gets to the appropriate AMP (Access Module Processor). The AMP stores the row on its associated (logical) disk. An AMP manages a logical or virtual disk which is mapped to multiple physical disks in a disk array. Teradata Parsing Engine(s) Message Passing Layer AMP 1 AMP 2 AMP 3 AMP 4 2 54 18 41 12 90 75 80 32 6 67 25 Records From Client (in random sequence) 2 32 67 12 90 6 54 75 18 25 80 41
  • 4. Teradata Retrieval Architecture The Parsing Engine dispatches a request to retrieve one or more rows. The Message Passing Layer insures that the appropriate AMP(s) are activated. The AMP(s) locate and retrieve desired row(s) in parallel access. Message Passing Layer returns the retrieved rows to PE. The PE returns row(s) to requesting client application. Teradata Parsing Engine(s) Message Passing Layer AMP 1 AMP 2 AMP 3 AMP 4 2 54 18 41 12 90 75 80 32 6 67 25 Rows retrieved from table 2 32 67 12 90 6 54 75 18 25 80 41
  • 5. Multiple Tables on Multiple AMPs EMPLOYEE Table DEPARTMENT Table JOB Table EMPLOYEE Rows DEPARTMENT Rows JOB Rows Parsing Engine Message Passing Layer Row from each table will usually be stored on each AMP. Each AMP may have rows from all tables. Ideally, each AMP will hold roughly the same amount of data. AMP 1 AMP 2 AMP 3 AMP 4 EMPLOYEE Rows DEPARTMENT Rows JOB Rows EMPLOYEE Rows DEPARTMENT Rows JOB Rows EMPLOYEE Rows DEPARTMENT Rows JOB Rows
  • 6. Linear Growth and Expandability Parsing Engine AMP SESSIONS PARALLEL PROCESSING DATA Disk • Teradata is a linearly expandable RDBMS. • Components may be added as requirements grow. • Linear scalability allows for increased workload without decreased throughput. • Performance impact of adding components is shown below. USERS AMPs DATA Performance Same Same Same Same Double Double Same Same Same Double Double Same Same Double Same Double Parsing Engine Parsing Engine Disk Disk AMP AMP
  • 7. Teradata Objects Examples of objects within a Teradata database or user include: Tables – rows and columns of data Views – predefined subsets of existing tables Macros – predefined, stored SQL statements Triggers – SQL statements associated with a table Stored Procedures – program stored within Teradata User-Defined Function – function (C program) to provide additional SQL functionality Join and Hash Indexes – separate index structures stored as objects within a database Permanent Journals – table used to store before and/or after images for recovery DATABASE or USER can have a mix of various objects. * - require Permanent Space These objects are created, maintained, and deleted using SQL. Object definitions are stored in the DD/D. TABLE 1 * TABLE 2 * TABLE 3 * VIEW 1 VIEW 2 MACRO 1 TRIGGER 1 Stored Procedure 1 * Join/Hash Index 1 * Permanent Journal * UDF 1 * VIEW 3 These aren't directly accessed by users.
  • 8. The Data Dictionary Directory (DD/D) The DD/D ... – is an integrated set of system tables – contains definitions of and information about all objects in the system – is entirely maintained by the Teradata Database – is “data about the data” or “metadata” – is distributed across all AMPs like all tables – may be queried by administrators or support staff – is normally accessed via Teradata supplied views Examples of DD/D views: DBC.TablesV – information about all tables DBC.UsersV – information about all users DBC.AllRightsV – information about access rights DBC.AllSpaceV – information about space utilization
  • 9. Structured Query Language (SQL) SQL is a query language for Relational Database Systems and is used to access Teradata. – A fourth-generation language – A set-oriented language – A non-procedural language (e.g., doesn’t have IF, DO, FOR NEXT, etc. ) SQL consists of: Data Definition Language (DDL) – Defines database structures (tables, users, views, macros, triggers, etc.) CREATE DROP ALTER Data Manipulation Language (DML) – Manipulates rows and data values SELECT INSERT UPDATE DELETE Data Control Language (DCL) – Grants and revokes access rights GRANT REVOKE Teradata SQL also includes Teradata Extensions to SQL HELP SHOW EXPLAIN CREATE MACRO
  • 10. CREATE TABLE – Example of DDL CREATE TABLE Employee (employee_number INTEGER NOT NULL ,manager_emp_number INTEGER COMPRESS ,dept_number INTEGER COMPRESS ,job_code INTEGER COMPRESS ,last_name CHAR(20) NOT NULL ,first_name VARCHAR (20) ,hire_date DATE FORMAT 'YYYY-MM-DD' ,birth_date DATE FORMAT 'YYYY-MM-DD' ,salary_amount DECIMAL (10,2) COMPRESS 0 ) UNIQUE PRIMARY INDEX (employee_number) INDEX (dept_number); Other DDL Examples CREATE INDEX (job_code) ON Employee ; DROP INDEX (job_code) ON Employee ; DROP TABLE Employee ;
  • 11. Views Views are pre-defined filters of existing tables consisting of specified columns and/or rows from the table(s). A single table view: – is a window into an underlying table – allows users to read and update a subset of the underlying table – has no data of its own EMPLOYEE (Table) MANAGER EMPLOYEE EMP DEPT JOB LAST FIRST HIRE BIRTH SALARY NUMBER NUMBER NUMBER CODE NAME NAME DATE DATE AMOUNT PK FK FK FK 1006 1019 301 312101 Stein John 861015 631015 3945000 1008 1019 301 312102 Kanieski Carol 870201 680517 3925000 1005 0801 403 431100 Ryan Loretta 861015 650910 4120000 1004 1003 401 412101 Johnson Darlene 861015 560423 4630000 1007 1005 403 432101 Villegas Arnando 870102 470131 5970000 1003 0801 401 411100 Trader James 860731 570619 4785000 Emp403_v (View) EMP NO DEPT NO LAST NAME FIRST NAME HIRE DATE 1005 403 Villegas Arnando 870102 801 403 Ryan Loretta 861015
  • 12. Multi-Table Views A multi-table view allows users to access data from multiple tables as if it were in a single table. Multi-table views (i.e., join views) are used for reading only, not updating. EMPLOYEE (Table) MANAGER EMPLOYEE EMP DEPT JOB LAST FIRST NUMBER NUMBER NUMBER CODE NAME NAME PK FK FK FK 1006 1019 301 312101 Stein John 1008 1019 301 312102 Kanieski Carol 1005 0801 403 431100 Ryan Loretta 1004 1003 401 412101 Johnson Darlene 1007 1005 403 432101 Villegas Arnando 1003 0801 401 411100 Trader James MANAGER DEPARTMENT (Table) DEPT DEPARTMENT BUDGET EMP NUMBER NAME AMOUNT NUMBER PK FK 501 Marketing Sales 80050000 1017 301 Research & Development 46560000 1019 302 Product Planning 22600000 1016 403 Education 93200000 1005 402 Software Support 30800000 1011 401 Customer Support 98230000 1003 EmpDept_v (View) Last_Name Department_Name Stein Research & Development Kanieski Research & Development Ryan Education Johnson Customer Support Villegas Education Trader Customer Support Joined Together Example of SQL to create a join view: CREATE VIEW EmpDept_v AS SELECT Last_Name ,Department_Name FROM Employee E INNER JOIN Department D ON E.dept_number = D.dept_number;
  • 13. Macros A MACRO is a predefined set of SQL statements which is logically stored in a database. Macros may be created for frequently occurring queries of sets of operations. Macros have many features and benefits: • Simplify end-user access • Control which operations may be performed by users • May accept user-provided parameter values • Are stored in the Teradata Database, thus available to all clients • Reduces query size, thus reduces LAN/channel traffic • Are optimized at execution time • May contain multiple SQL statements To create a macro: CREATE MACRO Customer_List AS (SELECT customer_name FROM Customer;); To execute a macro: EXEC Customer_List; To replace a macro: REPLACE MACRO Customer_List AS (SELECT customer_name, customer_number FROM Customer;);
  • 14. HELP Command Databases and Users: HELP DATABASE Customer_Service; HELP USER Dave_Jones; Tables, Views, Macros, etc.: HELP TABLE Employee; HELP VIEW Emp_v HELP MACRO Payroll_3; HELP COLUMN Employee.*; Employee.last_name; HELP INDEX Employee; HELP TRIGGER Raise_Trigger; HELP STATISTICS Employee; HELP CONSTRAINT Employee.over_21; HELP JOIN INDEX Cust_Order_JI; HELP SESSION; This is not an inclusive list of HELP commands. Example: HELP DATABASE Customer_Service; *** Help information returned. 15 rows. *** Total elapsed time was 1 second. Table/View/Macro name Kind Comment Contact T ? Customer T ? Cust_Comp_Orders V ? Cust_Order_JI I ? Department T ? : : : Orders T ? Orders_Temp O ? Orders_HI N ? Raise_Trigger G ? Set_Ansidate_on M ?
  • 15. SHOW Command SHOW commands display how an object was created. Examples include: Command Returns statement SHOW TABLE table_name; CREATE TABLE statement … SHOW VIEW view_name; CREATE VIEW ... SHOW MACRO macro_name; CREATE MACRO ... SHOW TRIGGER trigger_name; CREATE TRIGGER … SHOW PROCEDURE procedure_name; CREATE PROCEDURE … SHOW JOIN INDEX join_index_name; CREATE JOIN INDEX … SHOW TABLE Employee; CREATE SET TABLE PD.Employee, FALLBACK, NO BEFORE JOURNAL, NO AFTER JOURNAL, CHECKSUM = DEFAULT, DEFAULT MERGEBLOCKRATIO ( Employee_Number INTEGER NOT NULL, Emp_Mgr_Number INTEGER COMPRESS, Dept_Number INTEGER COMPRESS, Job_Code INTEGER COMPRESS, Last_Name CHAR(20) CHARACTER SET LATIN NOT CASESPECIFIC, First_Name VARCHAR(20) CHARACTER SET LATIN NOT CASESPECIFIC, Salary_Amount DECIMAL(10,2) COMPRESS 0) UNIQUE PRIMARY INDEX ( Employee_Number ) INDEX ( Dept_Number );
  • 16. EXPLAIN Facility The EXPLAIN modifier in front of any SQL statement generates an English translation of the Parser’s plan. The request is fully parsed and optimized, but not actually executed. EXPLAIN returns: • Text showing how a statement will be processed (a plan) • An estimate of how many rows will be involved • A relative cost of the request (in units of time) This information is useful for: • predicting row counts • predicting performance • testing queries before production • analyzing various approaches to a problem EXPLAIN SELECT * FROM Employee WHERE Dept_Number = 1018; : 3) We do an all-AMPs RETRIEVE step from PD.Employee by way of an all-rows scan with a condition of ("PD.Employee.Dept_Number = 1018") into Spool 1 (group_amps), which is built locally on the AMPs. The size of Spool 1 is estimated with high confidence to be 10 rows (730 bytes). The estimated time for this step is 0.14 seconds. 4) Finally, we send out an END TRANSACTION step to all AMPs involved in processing the request. -> The contents of Spool 1 are sent back to the user as the result of statement 1. The total estimated time is 0.14 seconds.
  • 17. Summary The major components of the Teradata Database are: Parsing Engines (PE) • Manage sessions for users • Parse, optimize, and send your request to the AMPs as execution steps • Returns answer set response back to client Message Passing Layer (MPL) • Allows PEs and AMPs to communicate with each other Access Module Processors (AMP) • Owns and manages its storage • Performs the steps sent by the PEs Virtual Disks (Vdisk) • Space owned by the AMP and is used to hold user data (rows within tables). • Maps to physical space in a disk array.
  • 18. Design and Developed by: Noor Alam, DW Architect & Project Manager, BI Solutions Data edge limited Mobile: 8801841320998 Email: alambd@gmail.com Skype: alam.ict