Teradata Performance Optimization
Teradata Performance Optimization
System Monitoring
Resource Usage Teradata Manager
Indexes
Types of Indexes supported by Teradata
Unique Primary Index Non-Unique Primary Index Unique Secondary Index Non-Unique Secondary Index
Unique/Non-Unique Indexes
A Unique Index identifies one & only one data row A Non-Unique Index identifies one or many data rows
Cont...
are called Large Table/Small Table (LT/ST) joins. The optimizer first joins the small tables together and then joins that result with the large table (also called as Product/Merge Join). To work well, the join fields of the small table must comprise an index of the large table. The join fields do not have to be indexes in the small table. Collect statistics for all tables on their indexes used in a query.
Explain Facility
Allows you to experiment with different approaches to an answer, then select the one that performs best. Provides information about the relative time the query would take to execute.
Macros
Teradata macros are SQL statements that are stored on the server and executed there. Macros are particularly useful for improving performance.
Views
Views provide a means for application programmers to develop and test SQL statements that are highly optimized. These views can then be provided to users who can use them without worrying about tying up system resources needlessly. Well written macros provide the same facility.
Compressing Columns
Most frequent value of a column can be compressed to reduce the row size. Tables with large numbers of rows and fields with limited numbers of unique values are very good candidates for compression. CPU cost overhead for compression processing is minimal.
as Correlated sub queries fully integrated with the global join plan to minimize the cost.
Case Expression
CASE expressions help increase performance because they
Cont.
analysis within the database engine itself taking full advantage of Teradata parallel architecture.
CALENDAR view for date related operations. Optimized Empty table INSERT/SELECT.
INSERT INTO Summary_Table SELECT * FROM Store1; INSERT INTO Summary_Table SELECT * FROM Store2; INSERT INTO Summary_Table SELECT * FROM Store3; INSERT INTO Summary_Table SELECT * FROM Store1 ; INSERT INTO Summary_Table SELECT * FROM Store2 ;INSERT INTO Summary_Table SELECT * FROM Store3;
Join Indexes
A Join Index is a data structure that stores and maintains join results. Frequently executed joins can be stored in Join Indexes to improve performance. Join Indexes are maintained automatically. Join Index Stores pre-joins without de-normalizing the database. Stores summary data without de-normalizing the database. Replicates the tables on the same AMP for join.
Hash Indexes
Hash indexes create a full or partial replication of a base table with a primary index on a foreign key column table to facilitate joins of very large tables by hashing them to the same AMP. Eliminate data distribution for join processing.
Priority Scheduling
Can be used to control resources allocated to users. Administrator can specify performance group while creating the user. It manages resource distribution to improve performance of one application at the expense of Performance Group other. Allocation Group
R Weight 40
Resource Partition
H M L
Weight
Weight Weight
20
10 5