Beruflich Dokumente
Kultur Dokumente
Jerry Klindt
(updated by Paul Sinclair)
October 20, 2004
Executive Summary
Introduction
A Second Example
Executive Summary
A Final Example
10
11
13
13
Summary
14
solutions.
the partition).
Test Description
Baseline
PPI
Improvement
59 seconds
one second
98% reduction in
elapsed time
58 seconds
two seconds
96% reduction in
elapsed time
239 seconds
one second
237 seconds
three seconds
98% reduction in
elapsed time
14,742 rows
per second
per node
may vary.
PPI provides.
error-prone.
The DBA, prior to Teradata Database
V2R5, had a need to speed up ad hoc
product_code CHAR(8),
sales_date DATE,
agent_id CHAR(8),
quantity_sold INTEGER,
October 2004).
other_columns CHAR(50))
is as follows:
CREATE TABLE SalesTable (
other_columns CHAR(50))
partitioning.
PARTITION BY RANGE_N
(sales_date BETWEEN
agent_id CHAR(8),
sales_date DATE,
quantity_sold INTEGER,
Compare current-month-to-date
product_code CHAR(8),
days of a month when a few of the transactions would be from the prior month.
in Ad hoc Queries
WITH DELETE;
Inserts
sales table.
No Degradation to Queries
Running Queries
be significantly changed.
Activity
Non-PPI Table
PPI Table
Improvement
Comments
Nightly inserts
Inserted rows
scattered throughout
table
Inserted rows
concentrated in one
partition
Faster performance
No changes to load
script needed.
Monthly delete of
one month of data
ALTER TABLE
statement deletes
partition
Much faster
performance
Easier maintenance
No change
needed
No SQL changes
Comparison of
current month to
prior month
Step is 12 times
faster (two partitions
of 25 read)
Little change
Joins
No direct merge
joins
Little change
Archive/Restore
(in Teradata
Database V2R6)
Entire table
Entire table or
selected partitions
Joins
Required
elimination.
No Impact to Short-Running
Queries
either case.
This is because in this example the partitioning column is part of the primary
index. In other situations, there could be
a significant impact.
greatest gain.
CREATE TABLE PPI_CallDetail (
phone_number DECIMAL(10)
NOT NULL,
call_start
TIMESTAMP,
call_duration
INTEGER,
other_columns
CHAR(30))
columns, follows:
phone_number
DECIMAL(10)
NOT NULL,
call_start
TIMESTAMP,
call_duration
INTEGER,
other_columns
CHAR(30))
Required
The primary index is currently defined as
unique, but would have to be defined as
non-unique if the table was partitioned.
A Final Example
TIMESTAMP,
INTEGER,
phone_number
call_start
call_duration
other_columns
DECIMAL(10)
NOT NULL,
CHAR(30))
ranges.
ence in performance.
Specifics of Defining a
PPI Table
expressions.
partition elimination.
selected partitions.
A join index or hash index that references a table using a row identier uses the wider format whether
or not the table has a partitioned primary index starting with Teradata Database V2R5.
be 65,535.
existing SQL.
A second potential advantage is faster
batch loads. If the table is partitioned
by transaction date, nightly loads of
transactions for the current day can be
dramatically improved. Similarly, the time
must be reached.
be restored.
Index Usage.
High-Level Trade-off
Considerations
Summary
PPI tables can dramatically improve
partitioning column.
Index Usage.
Teradata and NCR are registered trademarks of NCR Corporation. NCR continually enhances products as new technologies and components become available.
NCR, therefore, reserves the right to change specications without prior notice. All features, functions, and operations described herein may not be marketed in
all parts of the world. Consult your Teradata representative or visit Teradata.com for more information. No part of this publication may be reprinted or otherwise
reproduced without permission from Teradata.
This document, which includes the information contained herein, is the exclusive property of NCR Corporation. Any person is hereby authorized to view, copy, print,
and distribute this document subject to the following conditions. This document may be used for non-commercial, informational purposes only and is provided on
an AS-IS basis. Any copy of this document or portion thereof must include this copyright notice and all other restrictive legends appearing in this document.
Note that any product, process or technology described in the document may be the subject of other intellectual property rights reserved by NCR and are not
licensed hereunder. No license rights will be implied. Use, duplication or disclosure by the United States government is subject to the restrictions set forth in DFARS
252.227-7013 (c) (1) (ii) and FAR 52.227-19.
2004 NCR Corporation
Dayton, OH U.S.A.
Produced in U.S.A.