Вы находитесь на странице: 1из 120

Teradata Statistics Wizard

User Guide
Release 14.10
B035-2503-082K
October 2013
The product or products described in this book are licensed products of Teradata Corporation or its affiliates.
Teradata, Active Data Warehousing, Active Enterprise Intelligence, Applications-Within, Aprimo, Aprimo Marketing Studio, Aster, BYNET,
Claraview, DecisionCast, Gridscale, MyCommerce, Raising Intelligence, Smarter. Faster. Wins., SQL-MapReduce, Teradata Decision Experts,
"Teradata Labs" logo, "Teradata Raising Intelligence" logo, Teradata ServiceConnect, Teradata Source Experts, "Teradata The Best Decision Possible"
logo, The Best Decision Possible, WebAnalyst, and Xkoto are trademarks or registered trademarks of Teradata Corporation or its affiliates in the
United States and other countries.
Adaptec and SCSISelect are trademarks or registered trademarks of Adaptec, Inc.
AMD Opteron and Opteron are trademarks of Advanced Micro Devices, Inc.
Apache, Apache Hadoop, Hadoop, and the yellow elephant logo are either registered trademarks or trademarks of the Apache Software Foundation
in the United States and/or other countries.
Apple, Mac, and OS X all are registered trademarks of Apple Inc.
Axeda is a registered trademark of Axeda Corporation. Axeda Agents, Axeda Applications, Axeda Policy Manager, Axeda Enterprise, Axeda Access,
Axeda Software Management, Axeda Service, Axeda ServiceLink, and Firewall-Friendly are trademarks and Maximum Results and Maximum
Support are servicemarks of Axeda Corporation.
Data Domain, EMC, PowerPath, SRDF, and Symmetrix are registered trademarks of EMC Corporation.
GoldenGate is a trademark of Oracle.
Hewlett-Packard and HP are registered trademarks of Hewlett-Packard Company.
Hortonworks, the Hortonworks logo and other Hortonworks trademarks are trademarks of Hortonworks Inc. in the United States and other
countries.
Intel, Pentium, and XEON are registered trademarks of Intel Corporation.
IBM, CICS, RACF, Tivoli, and z/OS are registered trademarks of International Business Machines Corporation.
Linux is a registered trademark of Linus Torvalds.
LSI is a registered trademark of LSI Corporation.
Microsoft, Active Directory, Windows, Windows NT, and Windows Server are registered trademarks of Microsoft Corporation in the United States
and other countries.
NetVault is a trademark or registered trademark of Quest Software, Inc. in the United States and/or other countries.
Novell and SUSE are registered trademarks of Novell, Inc., in the United States and other countries.
Oracle, Java, and Solaris are registered trademarks of Oracle and/or its affiliates.
QLogic and SANbox are trademarks or registered trademarks of QLogic Corporation.
Quantum and the Quantum logo are trademarks of Quantum Corporation, registered in the U.S.A. and other countries.
Red Hat is a trademark of Red Hat, Inc., registered in the U.S. and other countries. Used under license.
SAS and SAS/C are trademarks or registered trademarks of SAS Institute Inc.
SPARC is a registered trademark of SPARC International, Inc.
Symantec, NetBackup, and VERITAS are trademarks or registered trademarks of Symantec Corporation or its affiliates in the United States and
other countries.
Unicode is a registered trademark of Unicode, Inc. in the United States and other countries.
UNIX is a registered trademark of The Open Group in the United States and other countries.
Other product and company names mentioned herein may be the trademarks of their respective owners.
THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROVIDED ON AN "AS-IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
NON-INFRINGEMENT. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION
MAY NOT APPLY TO YOU. IN NO EVENT WILL TERADATA CORPORATION BE LIABLE FOR ANY INDIRECT, DIRECT, SPECIAL, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS OR LOST SAVINGS, EVEN IF EXPRESSLY ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
The information contained in this document may contain references or cross-references to features, functions, products, or services that are not
announced or available in your country. Such references do not imply that Teradata Corporation intends to announce such features, functions,
products, or services in your country. Please consult your local Teradata Corporation representative for those features, functions, products, or
services available in your country.
Information contained in this document may contain technical inaccuracies or typographical errors. Information may be changed or updated
without notice. Teradata Corporation may also make improvements or changes in the products or services described in this information at any time
without notice.
To maintain the quality of our products and services, we would like your comments on the accuracy, clarity, organization, and value of this document.
Please email: teradata-books@lists.teradata.com.
Any comments or materials (collectively referred to as "Feedback") sent to Teradata Corporation will be deemed non-confidential. Teradata
Corporation will have no obligation of any kind with respect to Feedback and will be free to use, reproduce, disclose, exhibit, display, transform,
create derivative works of, and distribute the Feedback and derivative works thereof without limitation on a royalty-free basis. Further, Teradata
Corporation will be free to use any ideas, concepts, know-how, or techniques contained in such Feedback for any purpose whatsoever, including
developing, manufacturing, or marketing products or services incorporating Feedback.
Copyright 2002-2013 by Teradata Corporation. All Rights Reserved.
Teradata Statistics Wizard User Guide, Release 14.10 3
Preface
Purpose
This book provides information about Teradata

Statistics Wizard, which is a Teradata

Tools
and Utilities product. Teradata Tools and Utilities are a group of products designed to work
with the Teradata Database.
Teradata Statistics Wizard is a graphical tool that can improve the performance of queries and,
as a result, the entire Teradata Database. It reduces the time to collect data and eliminates the
need for constant customizing.
Audience
This book is intended for use by:
Database Administrators
Other technical personnel who are familiar with statistics collection and will be using
Teradata Statistics Wizard.
Supported Releases
This book supports the following releases:
Teradata Database 14.10
Teradata Tools and Utilities 14.10
Teradata Statistics Wizard User Guide 14.10.00.00
Note: See Version and copyright Information to verify the Teradata Statistics Wizard
User Guide version number.
To locate detailed supported-release information:
1 Go to http://www.info.teradata.com/.
2 Under Online Publications, click General Search.
3 Type 3119 in the Publication Product ID box.
4 Under Sort By, select Date.
5 Click Search.
6 Open the version of the Teradata Tools and Utilities ##.# Supported Platforms and Product
Versions spreadsheet associated with this release.
Preface
Prerequisites
4 Teradata Statistics Wizard User Guide, Release 14.10
The spreadsheet includes supported Teradata Database versions, platforms, and product
release numbers.
Prerequisites
The following prerequisite knowledge is required for this product:
Teradata Database
Teradata Statistics Collection
Microsoft

Windows

operating systems
Connectivity software, such as ODBC or CLI
Changes to This Book
The following changes were made to this book in support of the current release. Changes are
marked with change bars. For a complete list of changes to the product, see the Teradata Tools
and Utilities Release Definition associated with this release.
Additional Information
Additional information that supports this product and Teradata Tools and Utilities is available
at the web sites listed in the table that follows.
Date Description
October 2013
Version 14.10
Unicode glossary entry updated.
March 2013
Version 14.10
Removed all occurrences of the book title reference mmyx.
Statistics display interface should show additional data items introduced in
TD14.0 statistics
Display appropriate headers for statistics data: normal column statistics as
opposed to column partitioning statistics
November 2011
14.00
Changed all occurrences of 14.00.01 to 14.00, updated Supported Releases,
removed Teradata Database 14.0 footnote.
Added hyphens to UTF8 and UTF16.
Chapter 6: Added Low Frequency column in Interval Statistics window. See
To modify interval data on page 100.
Preface
Additional Information
Teradata Statistics Wizard User Guide, Release 14.10 5
Type of Information Description Access to Information
Release overview
Late information
Use the Release Definition for the following
information:
Overview of all of the products in the
release
Information received too late to be
included in the manuals
Operating systems and Teradata
Database versions that are certified to
work with each product
Version numbers of each product and
the documentation for each product
Information about available training
and the support center
1 Go to http://www.info.teradata.com/.
2 Under Online Publications, click General Search.
3 Type 2029 in the Publication Product IDbox.
4 Click Search.
5 Select the appropriate Release Definition from
the search results.
Preface
Additional Information
6 Teradata Statistics Wizard User Guide, Release 14.10
Additional product
information
Use the Teradata Information Products web
site to view or download specific manuals
that supply related or additional
information to this manual.
1 Go to http://www.info.teradata.com/.
2 Under the Online Publicationssubcategory,
Browse by Category, click Data Warehousing.
3 Do one of the following:
For a list of Teradata Tools and Utilities
documents, click Teradata Tools and Utilities,
and then select an item under Releasesor
Products.
Select a link to any of the data warehousing
publications categories listed.
Specific books related to Teradata Statistics Wizard
User Guide are as follows:
Data Dictionary (B035-1092)
Database Administration (B035-1093)
ODBC Driver for Teradata User Guide
(B035-2509)
SQL Request and Transaction Processing
(B035-1142)
SQL Data Definition Language
(B035-1144)
Teradata Call-Level Interface Version 2 Reference
for Network-Attached Systems
(B035-2417)
Teradata Index Wizard User Guide
(B035-2506)
Teradata Manager User Guide
(B035-2428)
Teradata System Emulation Tool User Guide
(B035-2492)
Teradata Tools and Utilities for Microsoft
Windows Installation Guide
(B035-2407)
Teradata Visual Explain User Guide
(B035-2504)
Utilities
(B035-1102)
Type of Information Description Access to Information
Preface
Additional Information
Teradata Statistics Wizard User Guide, Release 14.10 7
Additional product
information
(continued)
Teradata Query Scheduler User Guide (B035-
2512)
Teradata Query Scheduler Administrator Guide
(B035-2511)
Teradata Statistics Wizard User Guide (B035-
2503)
Messages
(B035-1096)
Teradata SQL Assistant for Microsoft Windows
User Guide
(B035-2430)
International Character Set Support (B035-1125)
CD-ROM images Access a link to a downloadable CD-ROM
image of all customer documentation for
this release. Customers are authorized to
create CD-ROMs for their use from this
image.
1 Go to http://www.info.teradata.com/.
2 Under the Online Publicationssubcategory,
Browse by Category, click Data Warehousing.
3 Click CD-ROMImages.
4 Follow the ordering instructions.
Ordering
information for
manuals
Use the Teradata Information Products web
site to order printed versions of manuals.
1 Go to http://www.info.teradata.com/.
2 Under Print &CD Publications, click Howto
Order.
3 Follow the ordering instructions.
General information
about Teradata
The Teradata home page provides links to
numerous sources of information about
Teradata. Links include:
Executive reports, case studies of
customer experiences with Teradata,
and thought leadership
Technical information, solutions, and
expert advice
Press releases, mentions, and media
resources
1 Go to Teradata.com.
2 Select a link.
Type of Information Description Access to Information
Preface
Additional Information
8 Teradata Statistics Wizard User Guide, Release 14.10
Teradata Statistics Wizard User Guide, Release 14.10 9
Table of Contents
Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
Supported Releases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4
Changes to This Book. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4
Additional Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4
Chapter 1:
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
How Does Teradata Statistics Wizard Work?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Using Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Chapter 2:
Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Before You Begin. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Steps for Best Practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Teradata Statistics Wizard Window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Menus and Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Menu Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
File Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Edit Menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
View Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Script Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Workload Menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Tools Menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Tools Menu When the Interval Statistics Pane is Open . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Window Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Table of Contents
10 Teradata Statistics Wizard User Guide, Release 14.10
Help Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28
Version and Copyright Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29
Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30
Connectivity Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30
General Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30
Recommendations Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31
Workload Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33
Table Pane Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
Workload Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36
Launching the Teradata Statistics Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38
Connecting to a Database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38
Selecting a Logon Method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38
Connecting Through ODBC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38
Connecting Through CLIv2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39
Retrieving Statistics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40
Searching for a Database, Table, or Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
Set Up a Query Capture Database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
View Low Level Error Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42
Chapter 3:
Defining Workloads, Creating and Applying Statistics
Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43
Defining a Workload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43
Defining a Workload From DBQL Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45
Defining a Workload Using Statement Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49
Defining a Workload From QCD Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52
Importing a Workload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54
Defining From an Existing Workload. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58
Definition Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
Updating an Existing Workload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
Cleaning up Workloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62
Creating the Statistics Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62
Applying the Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63
Table of Contents
Teradata Statistics Wizard User Guide 11
Chapter 4:
Statistics Analysis Reports. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Selecting a Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Statistics Recommendations Report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Update Frequency Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Table Usage Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Table Scan Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Workload Analysis Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Displaying Reports From a Previously Analyzed Workload. . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Chapter 5:
Options for Non-Workload Recommendations and Data
Retrieval. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Full or Sampled Statistics Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Getting Full Statistics Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Getting Sampled Statistics Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Statistics Collection Recommendation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Collection Recommendations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Statistics Re-Collection Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Re-Collection Recommendations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Retrieving Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Recommendation Icons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Viewing, Executing, or Scheduling Recommendations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Viewing Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Executing Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Scheduling Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Copy Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Chapter 6:
Managing Statistics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Collecting, Re-Collecting, or Dropping Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Collecting Statistics at the Column Level. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Re-Collecting or Dropping Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Partition Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Creating a Script for Deferred Execution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Displaying and Modifying the Interval Statistics for a Column or Index . . . . . . . . . . . . . . . 100
Table of Contents
12 Teradata Statistics Wizard User Guide, Release 14.10
History of Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104
Loner Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106
Column Partition Statistics Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106
Entering Statistics for Multiple Intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111
Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115
Teradata Statistics Wizard User Guide, Release 14.10 13
List of Figures
Figure 1: Panes in the Teradata Statistics Wizard window . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Figure 2: Interface with Menu Bar and Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Figure 3: Options Dialog Box with Connectivity Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Figure 4: Options Dialog Box with General Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Figure 5: Options Dialog Box with Recommendations Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Figure 6: Options Dialog Box with Workload Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Figure 7: Options Dialog Box with Table Pane Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Figure 8: Database Window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Figure 9: Setup QCD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Figure 10: Define Workload from DBQL Statements Screen . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Figure 11: Select Criteria Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Figure 12: Select Users and Accounts Selection Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Figure 13: Workload Definition via DBQL Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Figure 14: Statement Text Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Figure 15: Define Workload using Statements Screen. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Figure 16: Input USING Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Figure 17: Define Workload from QCD Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Figure 18: Import Options Screen. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Figure 19: Create from Existing Workload. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Figure 20: Workload Definition Summary Window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Figure 21: Workload Clean Up Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Figure 22: Statistics Recommendation Report Screen. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Figure 23: Execute/Schedules Recommendations Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Figure 24: Execution Results Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Figure 25: Teradata Statistics Wizard Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Figure 26: Selected Report Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Figure 27: Statistics Recommendation Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Figure 28: Update Frequency Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Figure 29: Table Usage Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Figure 30: Table Scan Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Figure 31: Workload Analysis Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Figure 32: View Reports Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
List of Figures
14 Teradata Statistics Wizard User Guide, Release 14.10
Figure 33: Select Recommendations Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74
Figure 34: Select Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76
Figure 35: Select Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77
Figure 36: Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79
Figure 37: Select Recommendations Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81
Figure 38: Select Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82
Figure 39: Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83
Figure 40: Updated table pane example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86
Figure 41: Recommendations table dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .88
Figure 42: Column Recommendations dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89
Figure 43: Column/Index pane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90
Figure 44: Schedule Recommendation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91
Figure 45: Copy Statistics Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95
Figure 46: Column/Index Pane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99
Figure 47: Interval Statistics Screen. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101
Figure 48: HIstory of Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105
Figure 49: Column Partition Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107
Figure 50: Add/Modify Intervals Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109
Teradata Statistics Wizard User Guide, Release 14.10 15
List of Tables
Table 1: File Menu Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Table 2: Edit Menu Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Table 3: View Menu Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Table 4: Script Menu Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Table 5: Workload Menu Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Table 6: Tools Menu Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Table 7: Tools Menu Commands - Interval Statistics Pane . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Table 8: Window Menu Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Table 9: Help Menu Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Table 10: About Teradata Statistics Wizard Dialog Box Description. . . . . . . . . . . . . . . . . . . . 29
Table 11: Connectivity tab options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Table 12: General tab options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Table 13: Recommendations tab options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Table 14: Workload tab options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Table 15: Table Pane tab options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Table 16: Workload Toolbar options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Table 17: Definition Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Table 18: Statistics Recommendation Report Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Table 19: Update Frequency Report Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Table 20: Table Usage Report Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Table 21: Table Scan Report Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Table 22: Workload Analysis Report Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Table 23: Setting Options to Retrieve Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Table 24: Table Pane Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Table 25: Recommendation Icons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Table 26: Schedule Recommendation Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Table 27: Collecting Statistics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Table 28: Re-Collecting or Dropping Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Table 29: Collecting Partition Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Table 30: History of Summary Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
List of Tables
16 Teradata Statistics Wizard User Guide, Release 14.10
Teradata Statistics Wizard User Guide, Release 14.10 17
CHAPTER 1
Introduction
As the Teradata Database becomes more powerful and complex, applications and the queries
they perform have also become more complex and sophisticated. The Teradata Statistics
Wizard is a graphical tool that can improve the performance of queries and, as a result, the
entire Teradata Database. It reduces the time to collect data and eliminates the need for
constant customization activity.
Teradata Statistics Wizard accomplishes this by automating the process of collecting statistics
for a particular workload or selecting arbitrary indexes or columns for collection/re-collection
purposes. Additionally, you can validate the proposed statistics on a production system which
enables you to verify the performance of the proposed statistics before applying the
recommendations.
Teradata Statistics Wizard enables the database administrator (DBA) to:
Specify a workload to be analyzed for recommendations specific to improving the
performance of the queries in a workload.
Select an arbitrary database or selection of tables, indexes, or columns for analysis,
collection, or re-collection of statistics.
Make recommendations, based on a specific workload.
Make recommendations, based on table demographics and general heuristics.
Defer executing the collection and dropping of statistics and schedule for a later time.
Display and modify the interval statistics for a column or index.
As changes are made within a database, Teradata Statistics Wizard identifies those changes and
recommends which tables to have statistics collected, based on age of data and table growth,
and which columns/indexes would benefit from having statistics defined and collected for a
specific workload. The DBA is then given the opportunity to accept or reject the
recommendations.
To learn more about Teradata Statistics Wizard, read:
Chapter 1: Introduction
Chapter 2: Getting Started
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Chapter 4: Statistics Analysis Reports
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Chapter 6: Managing Statistics
Chapter 1: Introduction
How Does Teradata Statistics Wizard Work?
18 Teradata Statistics Wizard User Guide, Release 14.10
How Does Teradata Statistics Wizard Work?
Teradata Statistics Wizard analyzes the workload (SQL statements) given to the system. A
workload is a set of queries that can be defined in any of the following ways:
Creating queries from the DBQL. See Defining a Workload From DBQL Statements on
page 45.
Manually entering the queries or loading queries from a file. See Defining a Workload
Using Statement Text on page 49.
Creating queries from the Query Capture Database (QCD). See Defining a Workload
From QCD Statements on page 52.
Creating queries from another workload. See Defining From an Existing Workload on
page 58.
Importing a workload from Teradata SET. See Importing a Workload on page 54.
When statistics are chosen by the system, Teradata Statistics Wizard makes recommendations
and provides reports to help you analyze the recommendations for collection purposes.
Additionally, Teradata Statistics Wizard permits you to validate the proposed statistics on a
production system which enables you to verify the performance of the proposed statistics
before applying the recommendations.
Teradata Statistics Wizard can be used in two modes:
Defined Workload Recommendations. See Chapter 3 Defining Workloads, Creating and
Applying Statistics Recommendations on page 43.
Arbitrary Selection Recommendations. See Chapter 5 Options for Non-Workload
Recommendations and Data Retrieval on page 73 and Chapter 6 Managing Statistics
on page 97.
Online Help
Using Online Help
Teradata Statistics Wizard online help answers questions about how to use Teradata Statistics
Wizard features. Online help (including context-sensitive help) opens in a new browser
window. Microsoft Internet Explorer, version 6.0 or later, is the recommended browser for
viewing online help and context-sensitive help. A browser other than the recommended
browser might result in incorrectly displayed help.
To open Help
From the toolbar, click .
Once the Help window is open, you can navigate to or search for other topics.
Chapter 1: Introduction
Online Help
Teradata Statistics Wizard User Guide, Release 14.10 19
To get Help within a windowor dialog box
From most windows and dialog boxes, press F1 to see context-sensitive Help for the
window or dialog box you are looking at. Occasionally when F1 will not invoke Help, press
Shi f t + F1.
Chapter 1: Introduction
Online Help
20 Teradata Statistics Wizard User Guide, Release 14.10
Teradata Statistics Wizard User Guide, Release 14.10 21
CHAPTER 2
Getting Started
Before using Teradata Statistics Wizard, read the following topics:
Before You Begin
Steps for Best Practices
User Interface
Menu Bar
Options
Workload Toolbar
Launching the Teradata Statistics Wizard
Connecting to a Database
Retrieving Statistics
Searching for a Database, Table, or Column
Before You Begin
Install the latest version of Teradata Visual Explain.
For information, refer to the Teradata Tools and Utilities for Microsoft Windows Installation
Guide B035-2407.
Install the latest version of connectivity software, either ODBC or CLIv2.
Check with your network administrator on their preference.
After choosing the connectivity software, specify the database to be used during the logon
process. For information, see Connecting to a Database on page 38.
To view or download the documents referenced in this user guide, see Additional
Information on page 4.
Steps for Best Practices
Identify the set of SQL statements that must be analyzed for performance improvements.
Define the identified set of SQL statements. This will be known as a workload.
Run the statistics analysis.
Validate the statistics.
Apply or schedule the execution of the recommendations.
Chapter 2: Getting Started
User Interface
22 Teradata Statistics Wizard User Guide, Release 14.10
User Interface
The Teradata Statistics Wizard window displays Teradata Database statistics in three panes.
The following figure is a typical view of the Teradata Statistics Wizard window.
Figure 1: Panes in the Teradata Statistics Wizard window
Teradata Statistics Wizard Window
Database Pane
The Databasepane is a listing of all the databases on the system and is located in the left
navigation pane of the window. Double-click on a database icon to see the children of that
database and to retrieve the associated tables.
Table Pane
The Tablepane lists the tables contained in the selected database and is located in the center
portion of the window. Double-click a table name to see the statistics for that table.
Chapter 2: Getting Started
Menu Bar
Teradata Statistics Wizard User Guide, Release 14.10 23
Column/Index Pane
The Column/Indexpane shows statistics for the selected database/table and is located in the
center portion of the window. Double-click a column name to see the interval statistics for
that column.
Menus and Toolbars
The interface consists of the following:
The Menu Bar, located along the top of the window, provides access to all the commands
you use to operate Teradata Statistics Wizard.
The toolbar, located under the menu bar, contains tool buttons you can click to quickly
perform many of the common commands found in the menu bar.
The Workload Toolbar, located along the left side of the window, contains tool buttons
you can click to perform operations specific to the workload statistics features.
Figure 2: Interface with Menu Bar and Toolbars
Menu Bar
The menu bar is located at the top of the Teradata Statistics Wizard window and contains
menus displaying the commands to operate Teradata Statistics Wizard.
In addition to accessing the commands from the menu bar, Teradata Statistics Wizard
provides shortcuts to many commands with the tool buttons along the top and left side of the
Menu
Toolbar
Workload
Toolbar
Chapter 2: Getting Started
Menu Bar
24 Teradata Statistics Wizard User Guide, Release 14.10
window. The next sections provide descriptions of the menu commands, as well as their
corresponding tool buttons.
File Menu
Edit Menu
View Menu
Script Menu
Workload Menu
Tools Menu
Window Menu
Help Menu
File Menu
The Filemenu provides commands for connecting and disconnecting from the database, as
well as loading, saving, and printing statistics. This is also the menu used to exit Teradata
Statistics Wizard.
Edit Menu
The Editmenu provides commands that undo, cut, copy, paste, find and replace.
Note: All commands, except Find, are only available when the Script window is open. The
Find command is also available when the database pane, table pane, or column pane is open.
Table 1: File Menu Commands
Menu Command
Toolbar
Button Description
Connect Connects to the Teradata Database server.
Disconnect Disconnects from the Teradata Database server.
Save As Saves the report as the required file.
Print Prints the report.
Note: The Print option is only available when the Table
pane, Column pane, or Script window is open.
Print Setup Sets the printer options
Exit Exits Teradata Statistics Wizard
Chapter 2: Getting Started
Menu Bar
Teradata Statistics Wizard User Guide, Release 14.10 25
View Menu
The Viewmenu provides commands that modify the display of the tool bars and status bar.
Script Menu
The Scriptmenu provides commands to record or erase previously recorded scripts. Also, you
can defer the execution of previously-recorded scripts.
Table 2: Edit Menu Commands
Menu Command
Toolbar
Button Description
Undo Undoes the last edit.
Cut Cuts the current selection to the clipboard.
Copy Copies the current selection to the clipboard.
Paste Pastes the contents of the clipboard at the insertion point.
Find Finds a text string in the current document.
Replace Replaces a found text string in the current document with
another one.
Table 3: View Menu Commands
Menu Command Description
Toolbar Toggles the toolbar and the workload toolbar on or off.
Status Bar Toggles the status bar on or off.
Font Change the font and size of the characters used in the displays
Table 4: Script Menu Commands
Menu Command Description
New Opens a new script for recording.
Turn Record ON Begins recording a script.
Clear Erases all the text in the Script window.
Submit for Deferred Execution Submits a script for execution some time in the future.
Chapter 2: Getting Started
Menu Bar
26 Teradata Statistics Wizard User Guide, Release 14.10
Workload Menu
The Workloadmenu provides commands to create, update, and clean up workloads; create a
new analysis and restart an analysis; select workload reports; validate recommendations; and
execute or schedule recommendations.
Tools Menu
The Toolsmenu provides commands to select arbitrary databases, tables, or indexes/columns
and collect or drop statistics, retrieve tables, change display options, and update selected
columns or indexes with selected interval values.
Refresh Refreshes the script window with the content of the recording.
Table 4: Script Menu Commands (continued)
Menu Command Description
Table 5: Workload Menu Commands
Menu Command Description
Workload > Create Creates a workload.
Workload > Update Existing Workload Modifies an existing workload.
Workload > Workload Cleanup Deletes a workload and/or the analysis made on the
workload.
Reports > Current Workload Displays the reports of the last analyzed workload.
Reports > Select Workload Displays reports from a previously analyzed workload.
Execute/Schedule Recommendations Executes or schedules the recommendations after they
have been accepted.
Table 6: Tools Menu Commands
Menu Command
Toolbar
Button Description
Collect Statistics >
Single Column/Index For Selected
Collects statistics on the currently selected items.
Collect Statistics >
Single-Column/Index Sampled
For Selected
Collects sampled single-column statistics (versus
non-sampled statistics) for the selected items.
Collect Statistics >
Multi-Columns From Selected
Collects multiple-column statistics from selected
items.
Chapter 2: Getting Started
Menu Bar
Teradata Statistics Wizard User Guide, Release 14.10 27
Collect Statistics >
Multi-Columns Sampled From
Selected
Collects sampled multiple-column statistics from
selected items.
Collect Statistics >
Table Level For Selected/Current
Re-collects statistics for the selected tables.
Collect Statistics >
Table Level Statistics (All DB)
Re-collects statistics for all databases.
Collect Statistics >
Copy Statistics
Copy statistics from source to target table.
Drop Statistics >
Selected Items
Drops statistics for the currently selected items.
Drop Statistics >
Current Table
Drops statistics for the current table.
Tables in All Databases Retrieves tables for all databases.
Retrieve/Collect
Recommendations (Selected)
Retrieves or obtains recommendations for the
selected tables.
Retrieve All Existing
Recommendations
Retrieves existing recommendations for selected
database.
Tables in All Databases Retrieves all tables within all the databases.
Teradata Index Wizard Accesses Teradata Index Wizard.
Teradata System Emulation Tool Accesses Teradata System Emulation Tool.
Teradata Visual Explain Accesses Teradata Visual Explain.
Get Statistics Recommendations Selects a recommendation type.
Setup QCD Opens the Setup QCD dialog box.
Table 6: Tools Menu Commands (continued)
Menu Command
Toolbar
Button Description
Chapter 2: Getting Started
Menu Bar
28 Teradata Statistics Wizard User Guide, Release 14.10
Tools Menu When the Interval Statistics Pane is Open
Window Menu
The Windowmenu provides commands to arrange the windows and icons at the bottom of the
window.
Help Menu
The Helpmenu provides commands to access the Teradata Statistics Wizard online Help.
Options Changes display options.
For more details, see Options on page 30.
Table 6: Tools Menu Commands (continued)
Menu Command
Toolbar
Button Description
Table 7: Tools Menu Commands - Interval Statistics Pane
Menu Command Description
Options Changes display options.
For descriptions of these options, see Options on page 30.
Table 8: Window Menu Commands
Menu Command Description
Cascade Arranges the windows so they overlap.
Tile Arranges the windows as non-overlapping tiles.
Arrange Icons Arranges the icons at the bottom of the window.
Refresh Refreshes the current window pane (Databases, Tables, or Columns/
Indexes).
Table 9: Help Menu Commands
Menu Command Toolbar Button Description
Help Topics Display a list of Help topics
About Teradata Statistics Wizard See Version and Copyright Information on
page 29.
Chapter 2: Getting Started
Menu Bar
Teradata Statistics Wizard User Guide, Release 14.10 29
Version and Copyright Information
The About Teradata Statistics Wizarddialog box, displays the version and copyright
information for the software.
To open the About Teradata Statistics Wizard dialog box
Click Help >About Teradata Statistics Wizard.
Copyright dates and legal notices are also provided.
Table 10: About Teradata Statistics Wizard Dialog Box Description
Field Description
Version Version number of the software installed.
Date Created Date the installed version of software was created.
System System name of the current connection.
Note: This information appears only when connected to a Teradata
Database.
Connection Type The connectivity type is indicated as one of the following:
ConnectedODBCwhen connected to Teradata Database with ODBC
connectivity.
Connected - CLIwhen connected to Teradata Database using CLI
connectivity.
Not Connectedwhen not connected to Teradata Database.
Character Set Displays the session character set used to connect to the Teradata Database.
Note: This information appears only when connected to a Teradata
Database.
User Name of the currently connected user.
Note: This information appears only when connected to a Teradata
Database.
Database Version Version level of the connected Teradata Database.
Note: This information appears only when connected to a Teradata
Database.
Database Release Release level of the connected Teradata Database.
Note: This information appears only when connected to a Teradata
Database.
Copyright The current copyright statement.
Chapter 2: Getting Started
Options
30 Teradata Statistics Wizard User Guide, Release 14.10
Options
Options are available for connectivity, recommendations, workload, and table pane as well as
enabling table level statistics.
To open the Options dialog box
1 Click Tools >Options.
The Optionsdialog box appears and presents options within tabs. These options are
described in the tables that follow.
2 Make selections and click Apply.
3 Click OKto close the Options dialog box.
Connectivity Tab
The following table describes the options in the Connectivitytab.
Figure 3: Options Dialog Box with Connectivity Tab
General Tab
The following table describes the option in the General tab.
Table 11: Connectivity tab options
Option Button Description
ODBC Connects to the Teradata Database using ODBC.
CLIv2 Connect to the Teradata Database using CLIv2.
Chapter 2: Getting Started
Options
Teradata Statistics Wizard User Guide, Release 14.10 31
Figure 4: Options Dialog Box with General Tab
Recommendations Tab
The following table describes the options in the Recommendations tab. Each category within
the Recommendationstab is associated with a different icon. These icons are used in
subsequent reports to indicate the type of recommendations that are available, based on the
options selected.
Table 12: General tab options
Check box Description
Enable Table Level Statistics (All DB) Menu Item Enables the menu item to include statistics at the
table level within all databases.
Default PermSpace for QCD creation (MB) The space for the QCD that is created during
workload creation.
Table 13: Recommendations tab options
Option Description Icon displayed
Age Of Collection When selected, the Age of Collectioncheck box
gives recommendations based on the number
of days since statistics were last collected.
Chapter 2: Getting Started
Options
32 Teradata Statistics Wizard User Guide, Release 14.10
Table Growth When selected, the Table Growthcheck box
gives recommendations based on the change
in the percentage of table growth since
statistics were last collected.
Table Skew
All Non-Unique Primary
Indexes
All Non-Unique Secondary
Indexes
Gives recommendations based on the table
skew.
General Heuristics
All Indexes for Join Index
(table)
All Non-Unique Secondary
Indexes (ALL Option)
All VOSI (Value Ordered NUSI)
All Partitioned Tables
Primary Index/Key
All Foreign Key(s)
Gives recommendations based on some
general rules of thumb.
Gives recommendations based on some
general rules of thumb.
Gives recommendations based on some
general rules of thumb.
When checked, Teradata Statistics Wizard
recommends collecting statistics for all
partitioned tables that do not have
partition statistics.
When checked, Teradata Statistics Wizard
recommends collecting statistics for tables
that have a primary index/key column that
does not contain statistics.
When checked, Teradata Statistics Wizard
recommends collecting statistics for tables
that have a foreign key column that does
not contain statistics.
Note: If a table is partitioned by a single
column, column statistics are inherited as
partition statistics by the Teradata Database
and a partition statistics recommendation
will not be generated.
Table 13: Recommendations tab options (continued)
Option Description Icon displayed
Chapter 2: Getting Started
Options
Teradata Statistics Wizard User Guide, Release 14.10 33
Figure 5: Options Dialog Box with Recommendations Tab
Workload Tab
The following table describes the options in the Workload Tab. Go to Creating Restricted
Views on page 34 for more information on using X views.
Table 14: Workload tab options
Check box Description
Use X views (DBC and QCD) Retrieve dictionary information and QCD data using X views.
Use X views (QCD only) Retrieve data from the QCD using X views.
Chapter 2: Getting Started
Options
34 Teradata Statistics Wizard User Guide, Release 14.10
Figure 6: Options Dialog Box with Workload Tab
Creating Restricted Views
Restricted DBC database views can be created to limit access to information. Restricted DBC
views are identified by the suffix X and called X views.
Beginning with Teradata Database 12.00.00, each system view in the DBC database includes a
view that supports Unicode. All Unicodesystem views are identified by a suffix, V or VX,
when a restricted Unicodeview is used.
Note: To learn more about X views, V views, and VX views, see Data Dictionary B035-1092
and Database Administration B035-1093 .
See Workload TabWorkload Tab on page 33 to access the Use X viewsoptions.
Additional Restricted views required by Teradata Statistics Wizard must be created in Teradata
Database. Teradata Statistics Wizard creates restricted views from a script file. There are five
versions of the script file:
DBCXViews62.bteq; used on Teradata Database V2R6.2, V2R6.1, or V2R6.0
DBCVXViews120.bteq; used on Teradata Database 12.00.00
DBCVXViews130.bteq; used on Teradata Database 13.00.00 and 13.10.00
DBCVXViews140.bteq; used on Teradata Database 14.0
DBCVXViews141.bteq; used on Teradata Database 14.10 and later
The script files are located in the Teradata installation folder. For example:
C:\Program Files\Teradata\Teradata Statistics Wizard 14.10\DBCXViews1410.bteq
Chapter 2: Getting Started
Options
Teradata Statistics Wizard User Guide, Release 14.10 35
To create restricted views
1 Click Tools >Options.
The Optionsdialog box appears.
2 Click the Workloadtab.
3 Select Use X views (DBC and QCD).
4 Connect to the Teradata Database.
A confirmation message appears.
5 Click Yesto create restricted views, or Noto proceed using Non X views.
If you clicked No, a confirmation message appears. Click OK.
Table Pane Tab
The following table describes the options in the Table Panetab.
Table 15: Table Pane tab options
Option Description
Retrieve Statistics for All Tables Automatically retrieves statistics for all tables in the selected
database, as statistics influence all recommendations made by
Teradata Statistics Wizard.
Retrieve Statistics for All Tables
and
Retrieve PermSpace for All
Tables
Select both of these options to automatically retrieve perm
space usage for all tables in the selected database, as Teradata
Statistics Wizard makes table skew recommendations based on
perm space usage.
Retrieve Statistics for All Tables
and
Retrieve RowCounts for All
Tables
Select both of these options to automatically retrieve row
counts for all tables in the selected database, as Teradata
Statistics Wizard makes table growth recommendations based
on row counts.
Enable Tables in All Databases
Menu Item
Activates the menu item that includes tables within all
databases.
Chapter 2: Getting Started
Workload Toolbar
36 Teradata Statistics Wizard User Guide, Release 14.10
Figure 7: Options Dialog Box with Table Pane Tab
For more information about the options in the Table Panetab, see Retrieving Data on
page 85.
Workload Toolbar
Teradata Statistics Wizard uses icons to visually depict the workload and analysis. The icons in
the toolbar on the left hand side of the Teradata Statistics window provide shortcuts for:
Defining, creating, importing, updating, and cleaning a workload
Creating analysis reports and applying recommendations
Launching Teradata Index Wizard
Table 16: Workload Toolbar options
Icon Description
Define workload from DBQL Statements
Define workload using Statements
Chapter 2: Getting Started
Workload Toolbar
Teradata Statistics Wizard User Guide, Release 14.10 37
Define workload from QDC Statements
Import workload
Create from an existing workload
Update existing workload.
Clean up workload
Create a Statistics Recommendations Report
View analysis reports
Apply or schedule recommendations
Launch Teradata Visual Explain
Launch Teradata Index Wizard
Table 16: Workload Toolbar options (continued)
Icon Description
Chapter 2: Getting Started
Launching the Teradata Statistics Wizard
38 Teradata Statistics Wizard User Guide, Release 14.10
Launching the Teradata Statistics Wizard
To start Teradata Statistics Wizard
1 Click Start >Programs >Teradata Statistics Wizard.
The Statistics Wizardwindow opens and is available to connect to a database.
2 Go to the next step, Connecting to a Database on page 38.
Connecting to a Database
To use Teradata Statistics Wizard, log on to a Teradata Database.
Selecting a Logon Method
To select a logon method before logging on
1 Go to Tools >Options.
2 Click the Connectivitytab.
3 Click either ODBC or CLIv2.
4 To connect to a database using ODBC, see Connecting Through ODBC on page 38.
or
To connect to a database using CLIv2, see Connecting Through CLIv2 on page 39.
After selecting a logon method, connect to a database using the procedures that follow.
Connecting Through ODBC
Teradata Statistics Wizard can connect to a database by ODBC.
Important: The following ODBC connection procedure assumes you have configured a data
source. If you have not configured a data source, refer to the ODBC Driver for Teradata User
Guide B035-2509 .
To connect to a database using ODBC
1 Click File >Connect.
The Please Select a Data Sourcedialog box appears.
2 Select a database from the list.
3 Click OK.
The Teradata Database Connectdialog box appears.
Chapter 2: Getting Started
Connecting to a Database
Teradata Statistics Wizard User Guide, Release 14.10 39
4 Enter the required information and click OKto logged on to the selected database. Refer to
the ODBC Driver for Teradata User Guide B035-2509 .
Connecting Through CLIv2
Teradata Statistics Wizard can connect to a database by CLIv2.
To connect to a database using CLIv2
1 Click File >Connect.
The Connect to Teradata Databasedialog box opens.
2 Use the following table to fill in the dialog box.
3 [Optional] Click Moreor Lessto show or hide the following Advanced Options.
Option Description
Database Name Specify a valid Teradata Database server name. For using the host name,
the IP Address of the server is stored in the Hosts file, if not
automatically available by DNS. The database name can also be selected
from the Database list. This option can be accessed by pressing Al t +R.
User Name Select the user name from the drop down list, or type in a valid user
name. The user name is defined for the server. This option can be
accessed by pressing Al t +U.
Password Enter the password for the user name defined in the User Name field.
This option can be accessed by pressing Al t +P.
Session Character Set Select the session character set from the drop down list. The session
character sets supported by the selected database are listed in the drop
down list.
Option Description
Authentication
Mechanism
Select from the list of mechanisms that automatically appear. Each
Teradata site implements their own security measures. If a list of
mechanisms does not appear and you cannot log on to the Teradata
Database, consult your DBA or the person responsible for the security
of the Teradata Database.
Authentication
Parameter
Type the parameters required by the selected mechanism. Asterisks
appear as type to conceal the authentication parameter.
If you do not know what to enter, consult your DBA.
Default Database [Optional] Specify the default database for the session.
Account String [Optional] Specify the log on account string. This option can be
accessed by pressing Al t +A.
Chapter 2: Getting Started
Retrieving Statistics
40 Teradata Statistics Wizard User Guide, Release 14.10
4 Click OKto accept the entries and close the Connect to Teradata Databasedialog box.
Note: If the logon information is not correctly entered into the dialog box, an error
message displays. Enter the correct information, and click OK.
Retrieving Statistics
After connecting to a Teradata Database System, a list of databases appears in the Teradata
Statistic Wizard window. See the following figure for an example.
Figure 8: Database Window
To retrieve statistics
1 Double-click a database.
The window splits and displays a list of tables within the database.
2 Double-click a table to retrieve statistics.
The window splits again and displays index information and other values. See User
Interface on page 22.
Chapter 2: Getting Started
Searching for a Database, Table, or Column
Teradata Statistics Wizard User Guide, Release 14.10 41
Searching for a Database, Table, or Column
To search for a database, table, or column
1 Right-click on the desired pane (database, table, or column) and select the Find option.
The Find dialog box opens.
2 Enter the name of the database, table, or column that you would like to find, and then click
Find Next.
3 Click Find Nextagain to continue searching.
This concludes the basics. For more in depth information about Teradata Statistics Wizard,
see Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations.
Set Up a Query Capture Database
You can create a QCD using Teradata Statistics Wizard so that you can create and analyze
workloads.
To set up a newQCD
1 Click Tools >Setup QCD.
The Setup QCDdialog box appears.
Figure 9: Setup QCD
Chapter 2: Getting Started
View Low Level Error Log
42 Teradata Statistics Wizard User Guide, Release 14.10
2 Click Create all QCF Database objects.
3 In the QCD Namefield, enter a name for the new QCD.
4 In the Ownerfield, enter an owner name. The owner name defaults to the name of the
current user.
5 In the PermSpacefield, enter a value for the permanent space you want to reserve for the
QCD and then select a unit of measurement (KB, MB, GB). The default value is 2 MB.
6 In the Spool Spacefield, enter a value for the spool space you want to reserve for the QCD
and then select a unit of measurement (KB, MB, GB). The default value is 0 MB.
7 [Optional] Select Fallbackto use fallback protection.
8 [Optional] Click Clearto clear all fields and to restore the default values.
9 [Optional] Click Commandto open the Execute SQL window.
10 Click Createto set up the QCD.
To modify the permanent space of a QCD
1 Click Tools >Setup QCD.
The Setup QCDdialog box appears.
2 Click Create all QCF Database objects.
3 In the QCD Namefield, enter the name of the QCD you want to modify.
4 In the Perm Space field, enter a new value for the permanent space you want to reserve for
the QCD and then select a unit of measurement (KB, MB, GB)
5 Click Modify Perm.
View Low Level Error Log
Teradata Statistics Wizard logs low level information useful for GSC in the TSWIZ.log file
located in following directory.
Drive:\Documents and Settings\user\My Documents\Teradata\DBM Logs\
Teradata Statistics Wizard User Guide, Release 14.10 43
CHAPTER 3
Defining Workloads, Creating and
Applying Statistics Recommendations
The starting point for a statistics design is the ability to capture representative samples of the
collected statistics. In other words, representative samples of active SQL statements. From
there, a workload is defined as an SQL statement or a set of SQL statements. Typically, a
workload is comprised of SQL statements that were executed on a production system. There
are several ways to define a workload and the following topics describe those ways:
Defining a Workload
Defining a Workload From DBQL Statements
Defining a Workload Using Statement Text
Defining a Workload From QCD Statements
Importing a Workload
Defining From an Existing Workload
The following topics may be helpful:
Updating an Existing Workload
Cleaning up Workloads
The action of defining the workload also performs statistics analysis. Once the workload is
defined and analyzed, the next step is obtaining the statistics recommendations. The following
topic discusses the process of producing the Statistics Recommendations Report.
Creating the Statistics Recommendations
The final step in the process is to apply the recommendations to the workload. The following
topic describes this process.
Applying the Recommendations
Defining a Workload
Teradata Statistics Wizard analyzes a workload and makes recommendations, based on the
defined workload. This section discusses defining a workload, based on the different types of
statements being used.
Teradata Statistics Wizard provides the following ways to define a workload:
Select queries from the Teradata Database Query Log (DBQL).
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Defining a Workload
44 Teradata Statistics Wizard User Guide, Release 14.10
Open a file and directly enter SQL statements into a workload, or select the SQL
statements from one or more files.
Select an existing set of execution plans in a user-defined Query Capture Database (QCD)
to form a workload.
Import SQL statements to the test system as a workload from a production system, using
the Teradata System Emulation Tool. The production system environment is imported
along with the SQL statements.
Enter the SQL statement manually to add or delete statements, and then optionally save
the modified workload under a different name, if needed.
A QCD is a database of relational tables that store the steps of any query plan captured by the
Query Capture Facility (QCF). For more information on QCDs, refer to the Teradata Visual
Explain User Guide B035-2504
To define a workload
1 Click Workload >Createand choose a statement definition method to create a workload
definition method. Statement definitions are listed in the following table.
2 After the workload is created and stored in the QCD, the Workload Definition Summary
dialog box appears, showing the workload. Select OKto complete the workload definition.
Definition Description
From DBQL Statements The Database Query Log (DBQL) provides the capability to store, in
system tables, the performance-related data for a request.
See Defining a Workload From DBQL Statements on page 45.
Using Statement Text SQL statements can be directly keyed into a workload and analyzed.
The SQL statements can also be selected from one or more files.
See Defining a Workload Using Statement Text on page 49.
From QCD Statements An existing set of execution plans in a QCD can be selected to define
a workload. The workload is created in the QCD in which the
execution plans exist.
See Defining a Workload From QCD Statements on page 52.
Import Workload Users can import workloads from other sources including other
Teradata client tools.
See Importing a Workload on page 54.
From Existing
Workload
An existing workload can be stored and modified at a later time.
Users can either add statements to the workload or remove them
from the workload. An option to save the modified workload using a
different workload name is also provided.
See Defining From an Existing Workload on page 58.
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Defining a Workload From DBQL Statements
Teradata Statistics Wizard User Guide, Release 14.10 45
After a workload is created and defined, it stays in the workload cache and is opened by default
in the Statistics Analysis Reports and Validations steps.
Defining a Workload From DBQL Statements
To define a workload fromDBQL statements
1 Click Workload >Create >FromDBQL Statements.
The Define Workload fromDBQL Statements dialog box appears.
Figure 10: Define Workload from DBQL Statements Screen
2 In the QCD Namebox, enter the QCD for the workload or click the QCD Name arrow for a
list of available QCDs.
3 If a workload has already been created, the workload name will appear in the Workload
Namebox. If no workload name appears, enter the workload name or click the Workload
Name arrow for a list of available workloads.
4 Under Select Table/View, click Views to retrieve the statements from views in the database.
or click Tables to retrieve the statements from tables in the database.
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Defining a Workload From DBQL Statements
46 Teradata Statistics Wizard User Guide, Release 14.10
5 Under Select DBQL option, click DBQL (selected by default) to create the workload by
browsing queries from DBQL or click External Databaseto create the workload by
browsing workload queries from an external database.
6 Click Next. The Select Criteria dialog box appears.
If the QCD name you entered does not exist, a message appears first asking if you want to
create a QCD. Click Yes to create the new QCD.
Figure 11: Select Criteria Screen
7 Fill in the options under Select Criteria as described in the following table.
Group/Option Option Description
Select Date Start Date Enter a start date in the format YYYY-MM-DD to use in
searching for queries on or after the date.
If no start date is specified all statements from the DBQL are
loaded.
End Date Enter an end date in the format YYYY-MM-DD to use in
searching for queries on or before the date.
If a start date is specified but no end date is specified, all
statements from the DBQL beginning at the start date are loaded.
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Defining a Workload From DBQL Statements
Teradata Statistics Wizard User Guide, Release 14.10 47
Select Time Start Time Enter a start time in the format HH-MM-SS to use in searching
for queries on or after the start time.
If no start time is specified, the default start time of 00:00:00 is
used.
End Time Enter an end time in the format HH-MM-SS to use in searching
for queries on or before the end time.
If no start time is specified, the default end time of 13:59:59 is
used.
Step Count Specifies the minimum number of steps for the queries retrieved
from the DBQL
Result Rows Specifies the minimum number of rows returned for the queries
retrieved from the DBQL
Note: This option is not available if connected to a V2R5 system.
Select Users and
Accounts
Click to create the workload from queries submitted by a set of
users or accounts from the Select Users and Accountsdialog box
Figure 12: Select Users and Accounts Selection Box
Browse a list of users and accounts, and select a user (one or
more) or account (one or more) to include the search. To make a
selection, highlight the name, and click Add. The user/account
name is displayed in the right hand side of the dialog box. Do this
for each user name and account to include. Click OK to save
additions and changes.
Note: By default, all users and accounts are selected.
Group/Option Option Description
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Defining a Workload From DBQL Statements
48 Teradata Statistics Wizard User Guide, Release 14.10
8 Click Next. The Workload Definition via DBQLdialog box appears showing all the queries
retrieved from the DBQL.
Figure 13: Workload Definition via DBQL Screen
To remove a query, select it from the list under ResRows and click Remove.
9 [Optional] Click Additional Criteriato view and edit the SQL statements in the Statement
Textdialog box.
Select
QueryBand
Name Enter the name of a Query Band Name-Value pair
Value Enter the value of a Query Band Name-Value pair
Filter Enter a filter to filter out some of the Query Band Name-Value
pairs
List Names Click to list all the Query Band Names in the Name-Value list
Add Click to add the selected Query Band Name-value pair to the
Name-Value list
Rem Click to remove the selected Query Band Name-value pair from
the Name-Value list
Group/Option Option Description
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Defining a Workload Using Statement Text
Teradata Statistics Wizard User Guide, Release 14.10 49
Figure 14: Statement Text Screen
10 Click Backto return to the previous dialog box. Click Finishto create the workload with
the selected queries.
11 After the workload is created and stored in the QCD, a Workload Summarydialog box
appears, showing the workload. Click OKto complete the workload definition.
Defining a Workload Using Statement Text
To define a workload using statement text
1 Click Workload >Create >Using Statement Text.
The Define Workload using Statementsdialog box appears.
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Defining a Workload Using Statement Text
50 Teradata Statistics Wizard User Guide, Release 14.10
Figure 15: Define Workload using Statements Screen
2 Enter the search criteria and SQL statement information as described in the following
table.
Option Description
SQL Statements In the box, enter the type of SQL statement to be analyzed, or click
Browseto locate a specific file.
Frequency The number of times this statement is executed in the workload. The
default is 1, meaning one time only, but this can be modified to occur
multiple times.
Add Adds the SQL statement text to the workload.
Browse Click Browseto locate the file containing the SQL statement.
Selected Statements
QCD Name Specifies the QCD on which the captured workload is created. Click . .
.to search existing QCDs.
If the QCD does not already exist, a message appears asking if you
want to create a QCD. Click Yesto create the QCD.
Workload Name Enter a name for the workload being created.
Note: Do not enter the name of an existing workload.
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Defining a Workload Using Statement Text
Teradata Statistics Wizard User Guide, Release 14.10 51
3 After the workload is created and stored in the QCD, a summary dialog box opens,
showing the workload. Select OKto complete the workload definition.
Input USING Values
When a query containing the USING clause is submitted in the execute SQL window, the Input
using values screen displays. See Figure 16 on page 52.
Statement Text Enter the text of an SQL statement if it is to be retrieved from the log.
Remove Click to remove the selected statements.
Replace Click to replace a text string in the current document with another
one.
OK Click to create the workload definition with the selections and close
the dialog box.
Cancel Click to cancel the workload definition and return to the Statistics
Wizard window.
Option Description
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Defining a Workload From QCD Statements
52 Teradata Statistics Wizard User Guide, Release 14.10
Figure 16: Input USING Values
1 The Using Query display box shows the query containing the USING clause.
2 The Using Variables display box shows the values for the Nameand Datatype variables.
3 For the Value variable, enter the data values in the Value column.
4 Click OKor Cancel:
Click OKto pass the variable data to the query during execution.
Click Cancel to prevent passing variable data to the query.
Defining a Workload From QCD Statements
To define a workload fromQCD statements
1 Click Workload >Create >FromQCD Statements.
The Define Workload fromQCD Statements dialog box appears.
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Defining a Workload From QCD Statements
Teradata Statistics Wizard User Guide, Release 14.10 53
Figure 17: Define Workload from QCD Statements
2 Enter a search criteria and QCD statement information as described in the following table.
Field Description
QCD Name Enter the name of the QCD database where the query is to be performed.
Query ID Enter a value to locate QCD statements, based on that Query ID tag value.
Query Tag Enter a value to locate QCD statements based on that Query tag value.
Browse QCD Click to locate QCD statements, based on the Query ID and/or Query Tag
values entered.
Query ID Query ID of the statements.
Frequency The number of times this statement is executed in the workload. The
default is 1, meaning one time only, but it can be modified to occur
multiple times.
Statement Text Enter the text of an SQL statement if it is to be retrieved from the log.
Workload Name Enter a name for the workload being created.
Note: Do not enter the name of an existing workload.
Select All Click to select all the statements in the list.
Deselect All Click to deselect all the statements in the list.
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Importing a Workload
54 Teradata Statistics Wizard User Guide, Release 14.10
3 After the workload is created and stored in the QCD, a summary dialog box appears,
showing the workload. Click OKto complete the workload definition.
Importing a Workload
SQL statements can be imported from another system to a test machine by following this
procedure.
To import a workload
1 Click Workload >Create >Import Workload.
The Select a File to Import Workload dialog box appears to browse files to find and choose
the workload file to import.
2 Choose the workload file to import.
The Import Workloaddialog box appears with the workload selected.
OK Click to create the workload definition using the selections and close the
dialog box to
Cancel Cancel the workload definition and return to the Statistics Wizard
window.
Field Description
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Importing a Workload
Teradata Statistics Wizard User Guide, Release 14.10 55
Figure 18: Import Options Screen
3 Select the appropriate import options as described in the following table.
Field Description
Import Into
Parent Database Parent directory where import information will reside. Click the
down-arrow to select from a list of directories, or click browse (...) to
bring up a list from which to choose a directory.
Target QCD Name Enter the QCD Name from which the workload will be imported, or
click browse (...) to bring up and select from a list of queries.
Ignore all errors Check this box to ignore all processing errors.
Select
QCD Name Enter the QCD Name under which SQL statements will be selected, or
click browse (...) to bring up and select from a list of SQL statements.
Workload Name Enter a name for the workload being created.
Note: Do not enter the name of an existing workload.
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Importing a Workload
56 Teradata Statistics Wizard User Guide, Release 14.10
Query ID Query ID of the statements.
Import Options
Import options affect how the workload is imported.
Object Definitions Captures the data model and data definition language (DLL).
Statistics Captures statistics while importing the workload.
Random AMP
Samples
Allows captured data from randomly sampled AMPs.
Demographics Captures data from the imported workload to create data
demographics.
Execution Plan Captures the execution plan.
WorkLoad Data Captures workload data.
OCD Data Captures OCD data.
Cost Parameters Imports the cost parameters.
Import Process the selections to import the workload.
Cancel Cancels the import process and returns to the Statistics Wizard
window.
Set TLE
The Test Level Emulation (TLE) opens the Set Target Emulationdialog box. The fields are
described as follows.
Set RAS tab
Select Table Names Displays the workload statements.
Session and System Select the RAS level at session level or system level.
Select All Select all workloads listed in the Table Names field.
Set Costs tab
Select Cost Tag Displays the workload statement.
Session, IFP, System Assign a cost level to the workload, whether at session level, IFP level,
or at system level.
Error Handling
The Error Handling button opens the Error Handling dialog box. The fields are described as
follows
General
Log only failures in
Summary Report
Logs failed operations into the summary report. Consult the log file
for the cause of any failures.
Field Description
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Importing a Workload
Teradata Statistics Wizard User Guide, Release 14.10 57
Ignore database errors Teradata Database error messages are ignored during import. If the
check box is cleared, all Teradata Database error messages are
displayed.
Automatically grant
missing access
privileges
Automatically generate the SQL statement to grant the necessary
access rights.
If selected, the Grant access privilegedialog box does not appear.
Instead, the SQL statement required to grant the necessary access
rights is automatically generated and submitted.
Revoke access
privileges
To revoke the access privileges granted from application.
Grant access
privileges on database
Generates SQL statement to grant the necessary access rights on the
required database instead of on a particular object reported on
missing access privilege error.
Import
Display Failed SQL
statement dialog
Displays the SQL Statement Failed dialog box. This dialog box allows
you to abort the import, ignore the error, or enter SQL to correct
insufficient privileges or permanent space errors. Teradata Database
errors that can be retried include: 2644, 2843, 3250, 3523, or 3524.
If the check box is cleared, errors are automatically ignored.
Display Object exists
dialog
Shows a message that the object already exists on the machine and
gives you the option to overwrite.
If you clear this check box, the Option drop-down box is enabled and
you can choose the following:
Yes To All drops all existing objects and recreate all exported objects.
No To All does not drop existing objects and continue with the import
operation.
Cancel automatically aborts the import operation if any objects
already exist.
Prompt to create non-
existing QCDs
Displays a message to create a QCD if the target QCD doesn't exist.
If this check box is cleared, a target QCD is created automatically.
Display duplicate primary key error
Field Description
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Defining From an Existing Workload
58 Teradata Statistics Wizard User Guide, Release 14.10
4 After entering the selections, click Import.
Defining From an Existing Workload
To create or define a new workload from an existing workload, consider these options:
What statement type to use
Frequency of each statement in the workload
Statements/workloads to be added
Note: The following procedure is also used to update an existing workload.
To define a workload froman existing workload
1 Click Workload >Create >FromExisting Workload.
The Create fromExisting Workloaddialog box appears.
RandomAMP samples Opens a dialog box that allows you to enter a new system name/RAS
tag if a duplicate prime key error occurs while importing Random
AMP Samples.
If you clear the Random AMP Samples check box and if the rows
already exist on the import system, the import operation will fail with
duplicate prime key errors.
Select Use the newtagfor the rest of the RAS import if you want the
new RAS tag used if duplicate primary key errors occur in the rest of
the import of the RAS rows. If you clear this check box, the same
dialog box displays for all RAS tags when the duplicate primary key
error occurs.
Workloads Opens a dialog box that allows you to enter a new workload name if a
duplicate prime key error occurs while importing workloads.
If you clear the Workloads check box and a workload already exists in
the target QCD, the import operation will fail with duplicate prime
key errors.
Cost Parameters, DBS
Control and Cost
Profile records
Opens a dialog box that allows you to enter a new cost tag if a
duplicate prime key error occurs while importing cost parameters.
If you clear the Cost Parameters check box and rows already exist on
the import system, the import operation will fail due to any duplicate
prime key errors.
If you select this check box, Index Wizard will also export
DBSControl records and active or inactive cost profiles.
Field Description
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Defining From an Existing Workload
Teradata Statistics Wizard User Guide, Release 14.10 59
Figure 19: Create from Existing Workload
2 For information about the fields and buttons in this dialog box, see To define a workload
from an existing workload on page 58.
3 Enter the QCD Name. Click the QCD Name arrow to select from a list of statements or click
... to bring up a list of statements.
4 Enter the Workload Name. Click the Workload Name arrow to select from a list of
statements or click ... to bring up a list of statements.
5 Under Add Statements click:
QCD Statements to add QCD Statements
Statement Textto add Statement text
Other Workloadto add an other workload
Click Browseto add statements/workloads. Click the down-arrow to select from a list of
statements/workloads, or click Browseto bring up a list.
If you select Other Workload and click Browse, the Add Workload Statementsdialog box
appears. In the Workload Name, click Browseto bring up a list.
6 After selecting the statement type, click Add to Listto add the statements to the Workloads
Statementlist. Continue to do this until all the statement types have been added.
7 When finished with the selection criteria, enter a new workload name in the NewWorkload
Namefield.
8 Click Create.
The new workload is defined and the Workload Definition Summarywindow appears.
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Defining From an Existing Workload
60 Teradata Statistics Wizard User Guide, Release 14.10
Figure 20: Workload Definition Summary Window
9 Click OKto exit and return to the Statistics Wizardmenu.
The following table describes the options in the Create fromExisting Workloaddialog box.
Option Description
Workload Statements
QCD Name Enter the name of the QCD database where the query is to be performed,
or click Browseto bring up a list from which to choose a database name.
Workload Name Enter the name of an existing workload to be queried.
Query ID Query ID of the statements.
Frequency The frequency with which an SQL statement is generated. The default is 1,
meaning one time only, but this can be modified to occur multiple times.
Statement Text Enter the text of an SQL statement if it is to be retrieved from the log.
Add Statements
Select from the statement types listed below:
QCD Statements An existing set of execution plans in a QCD can be selected to form a
workload.
Statement Text Enter the SQL statements to add to the workload.
Other Workload Create from an existing workload and add statements to the workload or
remove them from the workload.
Browse Click Browseto search through the existing workload files, or locate a
specific workload file, named in the Workload Namefield. When located,
click Createto create a new workload definition.
New Workload
Name
Enter a name for the workload being created.
Note: Do not enter the name of an existing workload.
Create Save the selections and close the dialog box to create the workload
definition.
Cancel Cancel the workload definition and return to the Statistics Wizard
window.
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Updating an Existing Workload
Teradata Statistics Wizard User Guide, Release 14.10 61
After a workload is defined, the next step is to analyze the workload and recommend
collection of statistics. To learn more about recommending collection of statistics, see
Creating the Statistics Recommendations on page 62.
Definition Errors
If an error occurs when the workload is being defined, a dialog box displays the error message.
Click OKto continue with options to proceed. Select one of the options, as described below,
and then click OK.
After a workload is defined, the next step is to create the Statistics Recommendation Report.
See Creating the Statistics Recommendations on page 62.
Note: All error messages are written to the TSWIZ.log file. Prior to Teradata Statistics Wizard
connecting to the Teradata Database, the default is:
x: \ Document s and Set t i ngs\ <userid>\ My Document s\ Ter adat a\ DBM Logs
After Teradata Statistics Wizard has connected to the Teradata Database, the default is:
x: \ Document s and Set t i ngs\ <userid>\ My
Document s\ Ter adat a\ Tswi z\ Pr of i l es\ <Dat abaseName>\ l ogs
Typically the TSWIZ.log does not appear in the logs directory until the data is written to it.
Updating an Existing Workload
After a workload is defined, it can be updated. For specifics on updating an existing workload,
follow the steps discussed in Defining From an Existing Workload on page 58.
Table 17: Definition Errors
Option Description
Create the workload
with the remaining
statements
Click to discard the failing plan and create the workload with the remaining
statements.
Click Browseto find valid statements and click Addto add valid statements
to the workload definition.
Note: If you do not select statements as suggested in the error message, the
workload definition will be aborted.
Cancel workload and
delete plans saved thus
far
Click to stop the workload creation process and delete the newly-created
plans.
Cancel workload and
retain plans saved thus
far
Click to stop the workload creation process, but retain the newly-created
plans in the QCD.
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Cleaning up Workloads
62 Teradata Statistics Wizard User Guide, Release 14.10
Cleaning up Workloads
Workload cleanup deletes workloads that are no longer need.
To clean up workloads
1 Click Workload >Workload Cleanup.
The Workload Clean Updialog box appears.
Figure 21: Workload Clean Up Screen
2 Enter the QCD Nameor click the QCD Namearrow to select from a list of names. Click ...to
bring up a list from which to choose.
3 Enter the Workload Nameor click the Workload Namearrow to select from a list of names.
Click ...to bring up a list from which to choose.
4 Select Delete Plans to delete the plans associated with the workload.
5 Click Deleteto delete the workload. Click Closeto cancel and return to the Statistics
Wizardmenu.
Creating the Statistics Recommendations
The next step of the process is to create the statistics recommendations for this workload.
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Applying the Recommendations
Teradata Statistics Wizard User Guide, Release 14.10 63
To create the statistics recommendation report
Click Workload >Reports >Current Workload >Statistics Recommendations, or click
on the Workload toolbar.
The recommendations are created and displayed in the Statistics Recommendations
Report.
Figure 22: Statistics Recommendation Report Screen
Applying the Recommendations
The final step of the process is to apply the recommendations.
Teradata Statistics Wizard provides two ways to implement the recommendations.
Create the statistics immediately
Schedule the statistics to be created in the future
To apply and schedule recommendations
1 Click Workload >Execute/Schedule Recommendations.
2 From the Execute/Schedule Recommendations dialog box, select recommendations to
apply from the list or click Select All to apply all the recommendations.
Chapter 3: Defining Workloads, Creating and Applying Statistics Recommendations
Applying the Recommendations
64 Teradata Statistics Wizard User Guide, Release 14.10
Figure 23: Execute/Schedules Recommendations Screen
3 To have the recommendation executed later click Scheduleand see Scheduling
Recommendations on page 91
To immediately execute the selected recommendation, click Execute
The Execution Results dialog box opens showing the table name, result, and statement.
Figure 24: Execution Results Screen
4 Click OK.
Teradata Statistics Wizard User Guide, Release 14.10 65
CHAPTER 4
Statistics Analysis Reports
This section discusses the Statistics Analysis reports that are generated after the
recommendations have been run.
Topics discussed include:
Selecting a Report
Displaying Reports From a Previously Analyzed Workload
Selecting a Report
When the workload is defined, the analysis reports are generated. This section gives a brief
overview of each report.
Reports are generated in tree form when the current workload is selected, or by selecting a
specific workload.
To viewreports fromthe current workload
1 Click Workload >Reports >Current Workload >[name of report].
A window appears with the available reports listed in the tree menu on the left. The Stats
Recommendations report opens by default.
Chapter 4: Statistics Analysis Reports
Selecting a Report
66 Teradata Statistics Wizard User Guide, Release 14.10
Figure 25: Teradata Statistics Wizard Screen
2 Select the report you wish to view in the tree menu on the left. The selected report appears
on the right side of the screen.
You can select from the following reports:
Statistics Recommendations Report
Update Frequency Report
Table Usage Report
Table Scan Report
Workload Analysis Report
3 As you scroll up and down while viewing the report on your screen, the row number is
highlighted.
Figure 26: Selected Report Screen
Chapter 4: Statistics Analysis Reports
Selecting a Report
Teradata Statistics Wizard User Guide, Release 14.10 67
Statistics Recommendations Report
This report contains information about the recommended set of statistics for the tables in the
workload. You can also access this report by clicking on the Workload toolbar.
Figure 27: Statistics Recommendation Report
The details of the report are as follows:
Update Frequency Report
The Update Frequency Report shows the percentage of statements within the workload that
are UPDATE statements.
This report is created when a workload is defined.
Table 18: Statistics Recommendation Report Description
Column Description
Database Name Name of the database.
Table Name Name of the table.
Statistics DDL The DDL statements used to collect statistics.
Chapter 4: Statistics Analysis Reports
Selecting a Report
68 Teradata Statistics Wizard User Guide, Release 14.10
Figure 28: Update Frequency Report
The details of the report are as follows:
Table Usage Report
The Table Usage Report shows information about how often the table is accessed within the
workload.
This report is created when a workload is defined.
Table 19: Update Frequency Report Description
Column Description
Database Name Name of database.
Table Name Name of table referenced in the workload.
Update Percentage The tables update percentage within the workload.
Chapter 4: Statistics Analysis Reports
Selecting a Report
Teradata Statistics Wizard User Guide, Release 14.10 69
Figure 29: Table Usage Report
The details of the report are as follows:
Table Scan Report
The Table Scan Report provides general information about the usage of a table including table
cardinality, AMP usage, and geography information in the workload.
Specifically, the report provides details about how the tables in the workload are used in the
different queries. For example, the report allows you to check whether a given table is
duplicated on the AMPs or is hash-redistributed, and so forth.
This report is created when a workload is defined.
Figure 30: Table Scan Report
The details of the report are as follows:
Table 20: Table Usage Report Description
Column Description
Database Name Name of database.
Table Name Name of table.
Statement Access Count The number of statements in the workload that access a
specific table.
Chapter 4: Statistics Analysis Reports
Selecting a Report
70 Teradata Statistics Wizard User Guide, Release 14.10
Workload Analysis Report
The Workload Analysis Report shows the cost estimate of the workload, relative execution cost
compared to the entire workload, statement text, frequency, and column types.
Note: For each statement, multiple rows exist in the report, one row per table.
Figure 31: Workload Analysis Report
The details of the report are as follows:
Table 21: Table Scan Report Description
Column Description
Database Name Name of database.
Table Name Name of table.
Row Estimate Estimate of the number of rows in the table.
Access Type Type of access made on the table.
Types include:
All AMP Retrieve
Single AMP Retrieve
Two AMP Retrieve
Group AMP Retrieve
Geography Geography of the relation. For example, it tells if the relation is hash
re-distributed, built locally, or duplicated to all AMPs.
Statement Text The text of the SQL statement for the individual table.
Table 22: Workload Analysis Report Description
Column Description
Statement Type Type of statements listed in the Statement Text column.
Cost Estimate (hh:mm:ss:sss) Original cost estimate of the statement before analysis.
Frequency Frequency of the statement.
Relative Cost Execution cost of the statement with respect to the execution cost
of the entire workload.
Database Name Name of database.
Chapter 4: Statistics Analysis Reports
Displaying Reports From a Previously Analyzed Workload
Teradata Statistics Wizard User Guide, Release 14.10 71
Displaying Reports From a Previously Analyzed
Workload
To display reports
1 Click Workload >Reports >Select Workload
The ViewReports dialog box appears.
Figure 32: View Reports Screen
2 In the QCD Namebox, enter the QCD name.
or
Click ... located to the right of the QCD Namebox, to show all QCDs on the server. The
QCDs will appear in the QCD Name list.
3 In the Workload Namebox, enter the workload name.
or
Table Name Tables accessed by the statement.
Value Access Columns Columns accessed by the statement in the table.
Join Columns Columns that are used in join conditions in the statement.
Range Access Columns Columns accessed in the range condition.
Statement Text Text of the SQL statement.
Table 22: Workload Analysis Report Description (continued)
Column Description
Chapter 4: Statistics Analysis Reports
Displaying Reports From a Previously Analyzed Workload
72 Teradata Statistics Wizard User Guide, Release 14.10
Click ...located to the right of the Workload Namebox, to show all available workloads on
the server. The workloads will appear in the Workload Namelist.
4 Select a previously analyzed workload. Click the cell containing the statement number,
frequency, or statement text.
5 Click View.
Teradata Statistics Wizard User Guide, Release 14.10 73
CHAPTER 5
Options for Non-Workload
Recommendations and Data Retrieval
Statistics recommendations can be made when collecting or re-collecting statistics. Teradata
Statistics Wizard includes options to:
Make recommendations about which column/index would benefit from having statistics
collected or re-collected, based on a tables demography and some general heuristics
Retrieve the necessary types of data and apply to a table
View, schedule, or execute recommendations
Set the options to specify data type and their thresholds, and which recommendations to
retrieve and their specified thresholds. Each type of recommendation is associated with an
icon, which is later displayed in the table and column panes and in the recommendation
dialogs to help identify the specified recommendations.
To review and set the user options, Click Tools >Options.
To read about the Tools menu, Options, see details provided in Tools Menu on page 26.
This section discusses:
Full or Sampled Statistics Recommendations
Statistics Collection Recommendation
Statistics Re-Collection Recommendations
Retrieving Data
Viewing, Executing, or Scheduling Recommendations
Copy Statistics
Full or Sampled Statistics Recommendations
Statistics about tables, columns, and indexes are critical in producing good query plans. The
three main methods of statistics gathering are random AMP sampling, full statistics
collection, and collection with the USING SAMPLE option.
The Get Statistics Recommendation tool gathers statistics from full statistics collection, and
the USING SAMPLE option.
The Get Statistics Recommendation tool retrieves recommendations based on:
Recollection attributes such as table growth and age of collection.
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Full or Sampled Statistics Recommendations
74 Teradata Statistics Wizard User Guide, Release 14.10
Collection attributes such as table skew, general heuristics, and newly added tables in the
database, or a newly created index in a table.
Attributes which recommend sampled statistics versus full statistics.
This section discusses:
Getting Full Statistics Recommendations
Getting Sampled Statistics Recommendations
Getting Full Statistics Recommendations
Full statistics recommendations are based on age of collection, table growth, table skew,
general statistics rules, and search for new tables or indexes. After a full statistics
recommendation is made, recommendations can be selected and executed immediately, or
saved to a file.
To get full statistics recommendations
1 Click Tools >Get Statistics Recommendations.
The Select Recommendations Typedialog box appears.
Figure 33: Select Recommendations Type
The options for the Get Statistics Recommendations dialog box are described in the
following table.
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Full or Sampled Statistics Recommendations
Teradata Statistics Wizard User Guide, Release 14.10 75
2 Click Full Statistics Recommendations, then click Nextto open the Select Objectsdialog
box.
Option Description
Full Statistics Recommendations Click this option to get
recommendations for tables,
columns, and indexes, based on the
following attributes:
Age of collection
Table growth
Table skew
General heuristics
Search for new tables/indexes
Sampled Statistics
Recommendations
Click this option to get a sampled
statistics recommendation that
includes re-collection attributes and
search for new tables or indexes (see
description above), and the
following attributes:
Tables with greater than 1000
rows per AMP
Unique indexes
Unique columns
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Full or Sampled Statistics Recommendations
76 Teradata Statistics Wizard User Guide, Release 14.10
Figure 34: Select Objects
In the Select Objects dialog box, the Available List contains databases and database objects
that can be added to, and removed from, the Selected List.
Finding a Database:
a In the Available List, either use the scroll bar to locate the database, or highlight tree
node Database at the top of the list.
b If Database is highlighted, click the Find Objects button to open the Finddialog box.
c Enter the database name in the Find What field, select any other find options, and click
Find Next. The database is highlighted in the Available List.
Notethat partial names can be entered in the Find Whatfield. If more than one match is
found they are highlighted and can be viewed by clicking the Find Nextbutton.
If no match is found, the following message displays: Search is complete.Could not
find (object)
Finding a Database Object:
Database objects, such as tables, are located using the same procedures described above for
databases, with the following differences:
a When the tree node Database, at the top of the Available Listis selected, all databases
are searched.
b When a database, such as DBC, in the Available Listis selected, only that database is
searched.
c All objects in a database can be viewed by double-clicking the database icon.
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Full or Sampled Statistics Recommendations
Teradata Statistics Wizard User Guide, Release 14.10 77
Adding and Removing Objects:
To add an object or database to the Selected List, select the object in the Available Listand
click the Add >>button.
To remove an object or database from the Selected List, select the object in the Selected
Listand click the <<Removebutton. The object is moved to the Available List.
3 When the selection process is complete, click Nextto open the Select Attributes dialog box.
shown below.
Figure 35: Select Attributes
4 Fill in the options for the Select Attributesdialog box, as described in the following table.
Note: The options in the Sampled Statistics group box become available when Sampled
Statistics Recommendationsis clicked in the Select Recommendation Typedialog box.
Option Description
Age of Last Collection Select check box to enter a number
of days. Teradata Statistics Wizard
recommends statistics based on the
number of days since the last
statistics were collected.
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Full or Sampled Statistics Recommendations
78 Teradata Statistics Wizard User Guide, Release 14.10
Table Growth Select the check box to enter a
percentage number for table
growth. Teradata Statistics Wizard
recommends statistics based on the
change in table growth percentage
since the last collection.
All Non-Unique Primary Indexes Select check box to enter a
percentage number. Teradata
Statistics Wizard recommends
statistics based on Table Skew.
All Non-Unique Secondary Indexes Select check box to enter a
percentage number. Teradata
Statistics Wizard recommends
statistics based on Table Skew.
All Indexes for Join Index (table) Select check box for
recommendations based on general
standard for Join Index.
All Non-Unique Secondary Indexes
(ALL Option)
Select check box for
recommendations based on general
standard for NUSI (All Option).
All VOSI (Value Ordered NUSI) Select check box for
recommendations based on some
general standard for All VOSI.
All Partitioned tables Select check box to collect statistics
for partitioning column(s) and the
system-derived column
PARTITION for all partitioned
tables that do not already have
statistics collected on them.
FromDate Select check box to recommend new
tables or indexes that were selected
in the Select Objectsdialog box,
based on the date entered. Select the
Tablesor Indexesoption.
Primary Index/Key When checked, Teradata Statistics
Wizard recommends collecting
statistics for tables that have a
primary index/key column that does
not contain statistics.
All Foreign Key(s) When checked, Teradata Statistics
Wizard recommends collecting
statistics for tables that have a
foreign key column that does not
contain statistics.
Option Description
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Full or Sampled Statistics Recommendations
Teradata Statistics Wizard User Guide, Release 14.10 79
5 Click Next. The Recommendationsdialog box appears.
Figure 36: Recommendations
Sample Percent When USING SAMPLE is specified,
the system automatically determines
what percentage of the data to scan,
usually 2% of the rows.
Teradata Statistics Wizard
recommends statistics based on
sample size for USING SAMPLE
statistics collection statements.
Table size Select check box to recommend
USING SAMPLE statistics
collection for tables with greater
than 1000 rows per AMP.
Unique columns Select the check box to recommend
USING SAMPLE statistics
collection on highly unique
columns of tables.
Unique Indices Select the check box to recommend
USING SAMPLE statistics
collection on unique indexes of
tables.
Option Description
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Full or Sampled Statistics Recommendations
80 Teradata Statistics Wizard User Guide, Release 14.10
The following table describes the columns of the Recommendations dialog box.
6 Click the check box to select the corresponding row of statistics recommendations. Or
click Select All to select all the displayed rows, or Deselect All to de-select the selected rows.
Note: To view details of any row, right-click on the row to display ViewReports.
7 Click the check box to select the corresponding row of statistics recommendations.
Execute Scheduleand Save to Filewill be enabled.
8 Click Finish.
Getting Sampled Statistics Recommendations
Collecting full statistics involves scanning the base table and performing a sort to compute the
number of occurrences for each distinct value. For some users, the time and resources
required to adequately collect statistics and keep the data current is problematic, particularly
for large tables.
Collecting statistics on a sample of data reduces the resources required, and the time to
perform statistics collection.
The USING SAMPLE statistics collection recommendation is:
Good for unique index columns
Column Description
Database Name Name of the database.
Table Name Name of the table.
Statistics DDL The DDL statements used to collect
statistics.
Criteria Displays the reason for the
recommendation.
Button Description
Execute Click this button to execute the
selected statistics recommendations
immediately.
Schedule Click this button to schedule the
selected statistics recommendations.
See Scheduling
Recommendations on page 91 for
more information.
Save to File Click this button to save the selected
statistics recommendations to a text
file.
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Full or Sampled Statistics Recommendations
Teradata Statistics Wizard User Guide, Release 14.10 81
Acceptable for highly unique columns or indexes
For tables too large for full statistics with a higher sampling percent
Avoid the Sampled Statistics Recommendations option for small tables. It is also not available
for global or volatile temporary tables, or join indexes.
The USING SAMPLE alternative was not designed to be a replacement for Full Statistics
Collection. It requires some analysis and planning to determine under which conditions it will
add benefit. This feature cannot be applied to global temporary tables or to join indexes.
To get sampled statistics recommendations
1 Click Tools >Get Statistics Recommendations.
The Select Recommendations Typedialog box appears.
Figure 37: Select Recommendations Type
2 Click Sampled Statistics Recommendations. For more information, see the table following
step 1 on page 74.
3 Click Next. The Select Objects dialog box appears.
4 From the Available List, double-click on the database to view available tables.
5 Select an object on the Available List, then click Add.
The selected objects appear in the Selected List.
6 Click Next.
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Full or Sampled Statistics Recommendations
82 Teradata Statistics Wizard User Guide, Release 14.10
The Select Attributesdialog box appears.
Figure 38: Select Attributes
7 Fill in the options for the Select Attributesdialog box, as described in the table following
step 4 on page 77.
8 Click Next. The Recommendationsdialog box appears.
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Full or Sampled Statistics Recommendations
Teradata Statistics Wizard User Guide, Release 14.10 83
Figure 39: Recommendations
9 Click the check box to select the corresponding row of statistics recommendations. Or
click Select All to select all the displayed rows.
Note: To view details of any row, right-click on the row to display ViewReports.
The following table describes the columns of the Recommendations dialog box.
10 Click the check box to select the corresponding row of statistics recommendations. Or
click Select All to select all the displayed rows, or Deselect All to de-select the selected rows.
Note: To view details of any row, right-click on the row to display ViewDetails.
11 Click the check box to select the corresponding row of statistics recommendations.
Execute Scheduleand Save to Filewill be enabled.
Column Description
Database Name Name of the database.
Table Name Name of the table.
Statistics DDL The DDL statements used to collect
statistics.
Criteria Displays the reason for the
recommendation.
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Statistics Collection Recommendation
84 Teradata Statistics Wizard User Guide, Release 14.10
12 Click Finish.
Statistics Collection Recommendation
Statistics collection recommendation is the process of recommending which columns will
benefit from having statistics collected. The recommendation is founded on a table
demography analysis where indexes are recommended for collection, if the table demography
analysis indicates that the sub-tables are skewed. The degree of skewness is user controlled and
can be set using the Toolsmenu. To set these options, see Tools Menu on page 26.
If you choose to specify statistics recommendations rather than capture representative samples
of collected statistics within a defined workload (see Chapter 3 Defining Workloads,
Creating and Applying Statistics Recommendations on page 43), you set user preferences
within the Tools menu, Options. Before Teradata Statistics Wizard can make these
recommendations, the appropriate options have to be enabled. Here, you can selectively
choose which recommendations to retrieve and their specific thresholds. These
recommendations are associated with different icons, which are later displayed in the Table
Pane, Column/Index Pane, and in the recommendation dialogs to help identify which
recommendations exist. For more information on all these options, see Tools Menu on
page 26.
Recommendations can be divided into collection and re-collection.
To review and set the user recommendations, go to Tools >Options >Recommendations.
Collection Recommendations
Collection recommendations are based on the following options. To change these options, see
Recommendations Tab on page 31.
Table skew recommends collection on all non-unique primary indexes for tables that have
table skews that exceed a user-configured threshold.
Button Description
Execute Click this button to execute the
selected statistics recommendations
immediately.
Schedule Click this button to schedule the
selected statistics recommendations.
See Scheduling
Recommendations on page 91 for
more information.
Save to File Click this button to save the selected
statistics recommendations to a text
file.
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Statistics Re-Collection Recommendations
Teradata Statistics Wizard User Guide, Release 14.10 85
General heuristics recommends collection based on some rules of thumb, including:
All indexes for Join Index table
All non-unique secondary indexes with ALL option
All VOSI (Value ordered NUSI)
All partitioned tables
Primary Index/Key
All Foreign Keys
Statistics Re-Collection Recommendations
Statistics re-collection recommendations is the process of making recommendations, based on
which tables with existing statistics would benefit from having statistics re-collected.
Re-Collection Recommendations
Re-collection recommendations are based on the age of collection and table growth.
Age of Collection
Age of collection recommends re-collecting all columns if the number of days since the
statistics were last collected exceed a user-configured threshold.
Table Growth
Table growth recommends re-collection for all columns that have the change in row count
since statistics were last collected, if they exceed a user-configured threshold.
There are two methods used to retrieve the current row count. The method used depends on
the total rows value, as discussed below.
If the total row count value from the existing statistics is less than one million, then the
current row count is retrieved by executing a select count (*) statement for the table.
If the total row count value is greater than or equal to one million, then the Ferret utility is
used via remote console connection to determine the current row count. This is done to
optimize the performance of the retrieval activity, since executing a select count (*) for a
very large table could take a long time.
Retrieving Data
In addition to enabling the recommendation options, the appropriate data needs to be
retrieved before the recommendations can be made. To review and set the user options for
retrieving data, go to Tools >Options >Table Pane. The options within the Table Pane tab are
exclusively used for selecting the types of data to collect within the Table Pane. (The Column/
Index Pane automatically collects the data regardless of whether or not these options are set.)
To read about the Tools menu, Options, see details provided in Tools Menu on page 26.
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Retrieving Data
86 Teradata Statistics Wizard User Guide, Release 14.10
When a user double-clicks on a database in the Database Pane, the Table Pane is updated with
the list of tables for that database, along with the options set in the Tools Menu.
Figure 40: Updated table pane example
The selected data displays in the columns within the Table Pane.
Table 23: Setting Options to Retrieve Data
To retrieve Select the following options
Data for all tables Retrieve Statistics for All Tables
Table skew recommendations Retrieve Statistics for All Tables
and
Retrieve Perm Space for All Tables
Table growth recommendations Retrieve Statistics for All Tables
and
Retrieve Row Counts for All Tables
Table 24: Table Pane Description
Column Description
Table Name Name of table.
Earliest Collection Earliest date when statistics were collected.
Latest Collection Latest date when statistics were collected.
Latest Stats Row Number of rows, as reported by the latest statistics collection.
Total # of Rows Actual number of rows.
Current Perm Current perm space
Peak Perm Peak perm space.
Skew % Percentage of table skew.
Join Index Table Yes = Table is a Join Index table.
No = Table is not a Join Index table.
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Retrieving Data
Teradata Statistics Wizard User Guide, Release 14.10 87
Note: The Access Count and Last Access columns display only when executed on Teradata
V2R5.1 or later.
When there are recommendations, they are identified with the same icons as seen in the Tools
menu, Options.
For more details about the Tools menu, Options, and their icons, see Tools Menu on
page 26.
Recommendation Icons
Access Count (see Note
below)
The number of times (or frequency) that the object (table or
column) has been accessed.
For single column indexes, the index access count displays if it exists,
and the Index Icon displays in this column. If the index access count
does not exist, the column access count displays, and no icon displays
in this column.
Last Access (see Note below) The timestamp when the object (table or column) was accessed.
Table 24: Table Pane Description (continued)
Column Description
Table 25: Recommendation Icons
If you want to Select Option ... Related Icon
Have recommendations based on the
number of days since statistics were last
collected
Age Of Collection
Have recommendations based on the change
in the percentage of table growth since
statistics were last collected
Table Growth
Have recommendations based on the table
skew
Table Skew
All Non-Unique Primary Indexes
All Non-Unique Secondary
Indexes
Have recommendations based on general
rules of thumb
General Heuristics
All Indexes for Join Index (table)
All Non-Unique Secondary
Indexes (ALL Option)
All VOSI (Value Ordered NUSI)
All Partitioned Tables
Primary Index/Key
All Foreign Keys)
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Viewing, Executing, or Scheduling Recommendations
88 Teradata Statistics Wizard User Guide, Release 14.10
Viewing, Executing, or Scheduling
Recommendations
To view, execute, or schedule recommendations, you can do one of two things within the Table
Pane:
Retrieve/Collect Recommendations (Selected) to retrieve recommendations for selected
tables only.
Note: If there are no recommendations due to the collection options being disabled, this
option will search for and retrieve the necessary data to produce recommendations.
Retrieve All Existing Recommendations to retrieve all recommendations.
Note: If there are no recommendations due to the collection options being disabled, there
will be no recommendations.
When recommendations are produced, the Recommendation table dialog box is displayed.
Figure 41: Recommendations table dialog box
The Recommendation Legend, displays a reminder of the types of recommendations and their
associated icons. Tables included in this Recommendations Tabledialog box have check marks
next to them. Clear or select individual tables, or click Select All or Deselect All.
Note: If you clear a table, all the selections at the column/index level are lost. If a table is
selected after it has been cleared selections in the Columns Recommendationsdialog box must
be made again.
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Viewing, Executing, or Scheduling Recommendations
Teradata Statistics Wizard User Guide, Release 14.10 89
Viewing Recommendations
To view the actual columns being recommended for a table, double-click within the row of a
table, except the Table Name column where you can selectively check or un-check individual
tables.
The Column Recommendations dialog box appears.
Figure 42: Column Recommendations dialog box
The Column Recommendations dialog box displays a list of columns/indexes. The columns
displayed in this dialog box are the same as those displayed in the Column/Index Pane. The
columns/indexes being recommended have check marks next to them and icons representing
the existing recommendations. Clear or select individual columns/indexes from the list, or
click Select All or Deselect All. Click Close to close the dialog box and save the selections.
Note: Executeand Scheduleare only available from the Tablepane.
Note: If you clear a table, all the selections at the column/index level are lost. If a table is
selected after it has been cleared selections in the Columns Recommendationsdialog box must
be made again.
After making column/index selections in the Column Recommendations dialog box, click
Executeor Schedulein the Recommendations Tabledialog box.
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Viewing, Executing, or Scheduling Recommendations
90 Teradata Statistics Wizard User Guide, Release 14.10
Executing Recommendations
Recommendations can be executed from the Tabledialog box or the Column/Indexpane.
Table Dialog Box
Click Executein the Recommendations Tabledialog box. The dialog will be updated with the
latest information.
Column/Index Pane
Double-click on a table in the Table Pane to update the Column/Index Pane with details about
the columns/indexes.
Figure 43: Column/Index pane
The columns contain the following information.
Column Description
Column Name Name of the column or index.
Index No The index number, if it is an index.
Index Type The index type, if it is an index.
Unique Y = Yes, it is unique, if it is an index.
N = No, it is not unique, if it is an index.
Unique Vals Number of unique values, if statistics exist for the column or index.
Date Date when statistics were collected.
Time Time when statistics were collected.
Percent Sampled Indicates the percentages where statistics were sampled. For example,
if you recently upgraded to V2R5, you can collect sampled statistics as
opposed to non-sampled statistics (100%).
Stat Rows Number of rows indicated by the collected statistics.
Access Count (see Note
below)
The number of times (or frequency) that the object (table or column)
has been accessed.
For single column indexes, the index access count displays if it exists,
and the Index Icon displays in this column. If the index access count
does not exist, the column access count displays, and no icon displays
in this column.
Last Access (see Note
below)
The timestamp when the object (table or column) was accessed.
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Viewing, Executing, or Scheduling Recommendations
Teradata Statistics Wizard User Guide, Release 14.10 91
Note: The Access Count and Last Access columns display only when executed on Teradata
V2R5.1 or later.
When the Column/Index Pane retrieves column/index information, it also retrieves the
statistics, perm space, and row count, regardless of how they are set within the Tools menu,
Options. This way, the necessary information is retrieved to make recommendations for the
table.
If the recommendation options are enabled in the Tools menu, Options, and there are
recommendations, the Table Pane will have the applicable icons, as displayed in the
descriptions of Recommendation Icons on page 87 and as discussed in the Tools Menu on
page 26.
The Table Growth icon is displayed in the Index Nocolumn.
The Age of Collection icon is displayed in the Datecolumn.
The Table Growth icon is displayed in the Stat Rowscolumn.
The General Heuristics icon is displayed in the Index Typecolumn.
Scheduling Recommendations
To schedule a task
1 Click Schedulein the Recommendations Tabledialog box to schedule the
recommendations to be executed later.
The Schedule Recommendation dialog box appears.
Figure 44: Schedule Recommendation
2 Enter information into the options as described in the following table.
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Viewing, Executing, or Scheduling Recommendations
92 Teradata Statistics Wizard User Guide, Release 14.10
Option Description
User Name (Read only) Indicates the User ID on which the session
was created. This is the same User ID specified at logon.
Schedule Name Type a name for the request.
Frequency Choose the frequency to run the request, using one of the
following:
Once
Daily
Weekly
Monthly
The frequency options available depend on the profile
type. The default frequency is Once - the scheduled SQL
statement executes only one time.
Start Days Enter the month, day, and year to run the request.
Selecting a different Frequency option changes these
values.
By default, this field is set to the first date when a
scheduled request execution time frame is available as
computed by the Teradata QS server.
If the Onceoption is selected, enter the month, day and
year when to execute the request in the corresponding
fields.
If the Dailyoption is selected, the fields in the Start Days
frame are not available.
If the Weeklyoption is selected, use the Days of the Week
check boxes to select the days to execute the request.
If the Monthlyoption is selected, enter the dates delimited
by a comma, in the Days of the Monthfield to select when
to execute the request.
Start Time If the Onceoption is selected, Enter the time when to run
the request in the Hour (0-23)field and the Minute (0-59)
field.
If the Daily, Weekly, or Monthlyoption is selected, enter
the time when to run the request in the Hour (0-23,*)field
and the Minute (0-59)field.
Individual hours may be entered as a comma-delimited
list.
A range of contiguous hours may be entered by
specifying the low hour followed by a hyphen (-),
followed by the high hour.
An asterisk (*) may be entered, representing all hours.
The default values indicate the next time the Teradata QS
server predicts the request can be executed.
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Viewing, Executing, or Scheduling Recommendations
Teradata Statistics Wizard User Guide, Release 14.10 93
3 Click Scheduleto schedule the recommendation at the specified time and date.
A message displays with the Request ID number and Job ID number. Make a note of these
numbers.
4 Click OK.
To view the request, open The Teradata Query Scheduler viewer and find the Request and
Job ID numbers.
For information on Teradata Query Scheduler, refer to the Teradata Query Scheduler
Administrator Guide B035-2511 and the Teradata Query Scheduler User Guide B035-2512 .
Schedule Recommendation Errors
The schedule recommendation feature may return an error message if Teradata Query
Scheduler Administrator is not set up correctly. The following is a list of possible errors.
MaximumStart Interval Days/Hours Enter the maximum interval beyond the start time that
the job can execute in the Dayand Hoursboxes.
For new requests, the initial value is determined by the
profile type. The default value is defined by the Teradata
QS Administrator.
Table 26: Schedule Recommendation Errors
Error Explanation Remedy
There are currently no
Scheduled Requests Server
active.
To schedule the
recommendations, a
Teradata Query Scheduler
session needs to be
created.
Ensure the server service
is started and retry. In the
Teradata Query Scheduler
Operationswindow,
select Server >Start.
Refer to the Teradata
Query Scheduler User
Guide B035-2512 ,for
information on the
Scheduler Operations
window.
Scheduling has not been
enabled by your query
scheduler administrator
This error occurs when the
Teradata Query Scheduler
Administrator setting for
Enable Schedulingis not
selected.
From the Teradata Query
Scheduler Administrator
window, select
Configuration >Enable
Scheduling.
Option Description
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Viewing, Executing, or Scheduling Recommendations
94 Teradata Statistics Wizard User Guide, Release 14.10
To correct schedule recommendation errors
Teradata Query Scheduler Administrator checks for at least one execution time frame during
the specified start interval for the request when other restrictions do not apply. If no time
frame executions are available, the request cannot be submitted and an error message appears.
1 Start Teradata Query Scheduler Administrator.
2 Click Configuration >Enabled Scheduling.
3 Click Configuration >Execution Time Frames.
The Execution Time Frames dialog box appears.
4 In Time Frame Names, highlight the entry you want to change, and click Edit.
The Time Frame Properties dialog box appears.
5 Verify that the following options are set:
Enable Time Framecheck box is selected.
The Every Daycheck box is selected, or one or more of the check boxes are selected in
Days.
The Time Fromand Time Toentries are between 0 and 24.
6 Click OK.
7 Click Close.
Scheduler execution time
frames are not currently
available
The execution time frames
of Teradata Query
Scheduler Administrator
Configurationsettings are
not configured for the
specified time. There is no
window available to
schedule the request in the
specified time.
From the Teradata Query
Scheduler Administrator
window, select
Configuration >Execution
Time Frames.
Unable to create session An unknown error
occurred while retrieving
the scheduling
information from
Teradata Query Scheduler
Administrator.
From the Teradata Query
Scheduler Administrator
window, check the
settings and retry.
Table 26: Schedule Recommendation Errors (continued)
Error Explanation Remedy
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Copy Statistics
Teradata Statistics Wizard User Guide, Release 14.10 95
Copy Statistics
To Copy Statistics froma Source Table to a Target Table
Use the following steps to copy statistics from one table to another table:
1 In the Table Pane list of tables, which are contained in the selected database, right-click on
the source table name to open the shortcut menu.
2 In the shortcut menu, select the Copy Statistics menu item to open the Copy Statistics
dialog box.
Figure 45: Copy Statistics Window
3 The following table describes the functionality of the Copy Statisticsdialog box.
Field/Control Description
FromObject Object name (Table, View, or Query) from where the statistics are copied
(grayed).
FromDatabase Database name from where the object is derived for copying statistics.
To Object Object name (Table, View, or Query) to which the statistics are copied.
Chapter 5: Options for Non-Workload Recommendations and Data Retrieval
Copy Statistics
96 Teradata Statistics Wizard User Guide, Release 14.10
Note: a) If the target table contains previously defined statistics, the following message
appears:
(Suggested wording) The target table contains previously defined statistics. click OK to
overwrite the existing statistics, or click Cancel to take no action.
Use one of the following options:
Click OK to overwrite the existing statistics.
Click Cancel to take no action.
b) If the above message does not appear, click Copy to copy the statistics from the source
table to the target table.
To Database Select a database name where the statistics are stored in the object for the
selected database name.
Copy Copies statistics from the source object to the target object.
More or Less [Optional] Click More or Less to show or hide the following options
including the Available Statistics Listbox and the Selected Statistics List
box.
Add Adds the column selected from the Available Statistics Listto the object in
the Selected Statistics List.
Remove Removes a selected column from the Selected Statistics List.
Add All Adds all columns selected fro the Available Statistics Listto the object in
the Selected Statistics List.
Remove All Removes selected columns from the Selected Statistics List.
Field/Control Description
Teradata Statistics Wizard User Guide, Release 14.10 97
CHAPTER 6
Managing Statistics
Use Teradata Statistics Wizard options to:
Collect, re-collect, or drop statistics, based on an arbitrary database, table, or column/
index
Display and modify interval statistics for a column or index
Collect, re-collect, or drop statistics are options that are set within the Tools menu, Options.
Set these options, to specify data type and their thresholds, and then selectively choose which
recommendations to retrieve and their specified thresholds. Each type of recommendation is
associated with an icon, which is later displayed in the table and column panes and in the
recommendation dialogs to help identify the specified recommendations.
For detailed information on collecting and dropping statistics, refer to SQL Data Definition
Language.
To review and set the user options, click Tools >Options.
To read about the Tools menu, see Tools Menu on page 26.
This section discusses:
Collecting, Re-Collecting, or Dropping Statistics
Displaying and Modifying the Interval Statistics for a Column or Index
Collecting, Re-Collecting, or Dropping Statistics
In addition to making recommendations, use Teradata Statistics Wizard to collect, re-collect,
or drop statistics on a database and one or more tables, columns, or indexes.
Collecting Statistics at the Column Level
At the Column level, you can collect different types of statistics.
Table 27: Collecting Statistics
If you want to Do the following
Collect single column statistics for
columns or indexes
From the Column/Indexpane, select the column(s) or
index(es). Right-click and select Collect Single-Column/Index
Statistics For Selected.
Chapter 6: Managing Statistics
Collecting, Re-Collecting, or Dropping Statistics
98 Teradata Statistics Wizard User Guide, Release 14.10
Re-Collecting or Dropping Statistics
Other available options to re-collect or drop statistics are listed below. When recollecting
statistics, statistics are only collected if the table has statistics defined.
Note: When you right-click in a pane (database, table, or column/index) to select options,
you need to click in the appropriate column to get the options dialog box. For example, when
you click in the Tablepane, you need to right-click in the Table Namecolumn. When you click
in the Columnpane, you need to right-click in the Column Name column. This will ensure that
the correct Options menu is displayed.
Collect sampled single column
statistics for columns or indexes
From the Column/Index pane, select the column(s) or
index(es). Right-click and select Collect Single-Column/Index
Sampled Statistics For Selected.
Collect multi-column statistics From the Column/Indexpane, select the columns. Right-click
and select Collect Multi-Column Statistics FromSelected.
Collect sampled multi-column
statistics
From the Column/Index pane, select the columns. Right-click
and select Collect Multi-Column Sampled Statistics From
Selected.
Table 27: Collecting Statistics (continued)
If you want to Do the following
Table 28: Re-Collecting or Dropping Statistics
If you want to Do the following
Re-collect statistics for a database From the Databasepane, click to highlight the database.
Right-click and select Collect for Selected Database.
Drop statistics for a database From the Databasepane click to highlight the database. Right-
click and select Drop for Selected Database.
Re-collect statistics for one or
more tables
From the Table pane, click to highlight the table(s). To select
multiple tables, press and hold Shi f t as you click. Right-
click and select Collect for Selected table(s).
Drop statistics for one or more
tables
From the Table pane, click to highlight the table(s). To select
multiple tables, press and hold Shi f t as you click. Right-click
and select Drop for Selected table(s).
Re-collect statistics for a table From the Table pane, double-click the table containing the
columns you want to drop. From the Column/Index pane,
right-click and select Collect Statistics for Table.
Drop statistics for a table From the Table pane, double-click the table containing the
columns you want to drop. From the Column/Indexpane,
right-click and select Drop Statistics for Table.
Chapter 6: Managing Statistics
Collecting, Re-Collecting, or Dropping Statistics
Teradata Statistics Wizard User Guide, Release 14.10 99
Partition Statistics
With the partition statistics feature, you can collect statistics on the system-derived column
PARTITION. These statistics enable the Optimizer to cost various PPI operations more
accurately; therefore, it is highly recommended to always collect partition statistics for all
partitioned tables.
For partitioned tables, the ColumnName has an extra row named PARTITION to signify the
partition. All existing statistics options perform the same way; however, when the
PARTITION row is selected, partition statistics are collected or dropped instead of the regular
column statistics.
Figure 46: Column/Index Pane
Drop statistics for one or more
columns
From the Table pane, double-click the table containing the
columns you want to drop. From the Column/Indexpane, click
to highlight the column(s). To select multiple tables, press and
hold Shi f t as you click. Right-click and select Drop Statistics
for Selected.
Table 28: Re-Collecting or Dropping Statistics (continued)
If you want to Do the following
Table 29: Collecting Partition Statistics
If you want to Do the following
Collect partition statistics From the Column/Indexpane, select the PARTITION row.
Right-click and select Collect Single-Column/Index Statistics
For Selected.
Collect sample partition statistics From the Column/Indexpane, select the PARTITION row.
Right-click and select Collect Single-Column/Index Sampled
Statistics For Selected.
Collect multi-column partition
statistics
From the Column/Indexpane, select the PARTITION row and
one or more columns. Right-click and select Collect Multi-
Column Statistics FromSelected.
Collect multi-column sample
partition statistics
From the Column/Indexpane, select the PARTITION row and
one or more columns. Right-click and select Collect Multi-
Column Sampled Statistics FromSelected.
Chapter 6: Managing Statistics
Displaying and Modifying the Interval Statistics for a Column or Index
100 Teradata Statistics Wizard User Guide, Release 14.10
Creating a Script for Deferred Execution
Collect and Drop statistic operations can be executed as they are invoked or scheduled to be
executed through a script at a later scheduled time. To learn more about the Script menu
options, see Script Menu on page 25.
To create a script to execute deferred statistic operations
1 Go to the Script menu and select Turn Record ONto turn on the script recording.
A check mark is displayed next to the selection to show that the recording feature is turned
on.
As soon as this feature is activated, all Collect and Drop statistics operations are recorded,
rather than executed. The recording continues until the recording feature check box is
cleared.
Note: The recording feature can be deactivated at any time. To deactivate the recording
feature or verify that it is turned off, go to the Scriptmenu and select Turn Record ONso it
is unchecked (deactivated). Recording will no longer take place.
2 Open a script by clicking Script >New.
A Script dialog box opens with the content of the recording.
Edit and save the script.
Click Clear to cancel the recording.
3 To schedule the deferred statistic operation, click Script >Submit for Deferred Execution.
4 Set the schedule options. See Scheduling Recommendations on page 91.
Displaying and Modifying the Interval Statistics
for a Column or Index
Teradata Statistics Wizard has the ability to modify interval data and submit it back to the
Teradata Database.
To modify interval data
1 Double-click in a column or index in the Column/Index Pane.
The Interval Statisticsdialog box appears.
Chapter 6: Managing Statistics
Displaying and Modifying the Interval Statistics for a Column or Index
Teradata Statistics Wizard User Guide, Release 14.10 101
Figure 47: Interval Statistics Screen
2 Fill in the options as described in the following table.
Group/Option Option Description
Statistics Information Database Displays the name of database where the table exists.
Table Name Displays the name of table where the column exists.
Column Name Displays the name of column associated with the interval statistics.
TimeStamp Displays the TimeStamp when Statistics are collected for a column.
Version For internal use.
Chapter 6: Managing Statistics
Displaying and Modifying the Interval Statistics for a Column or Index
102 Teradata Statistics Wizard User Guide, Release 14.10
Summary Information Original Version Displays the Current Statistic Version.
DBS Version Displays the Database version.
UsageType Displays the Usage type of the statistics. Valued values are S for Summary
mode and D for Detailed mode.
Complex Stat
Information
Displays the information for Statistics on Complex Types such as Geospatial.
Number of
Biased Values
Displays the Number of Biased Values.
Number of EH
Intervals
Displays the Number of EH Intervals.
Number of
History Records
Displays the Number of History Records.
Sample Percent Displays the percentage of statistics sampled if statistics were collected on the
column.
Number of Nulls Displays the number of rows with one of the statistics fields being null.
Note: This information is about the column as a whole. This is also known as
interval 0 data.
Number of All
Nulls
Displays the number of rows with all of the statistics fields being nulls.
Number of Partial
Null Values
Displays the Number of Partial Null Values.
Partial Null HMF Displays the highest frequency of values having partial nulls of the Expression
List.
Average AMP
Rows per Value
Displays the average AMP-local Rows per Value from each AMP.
Group/Option Option Description
Chapter 6: Managing Statistics
Displaying and Modifying the Interval Statistics for a Column or Index
Teradata Statistics Wizard User Guide, Release 14.10 103
Min Value Minimum value for the entire column/index.
For example, if entering a date value, it must be in the form of MMDDYYYY.
Note: This information is about the column as a whole. This is also known as
interval 0 data.
Max Value Maximum value for the entire column/index.
For example, if entering a date value, it must be in the form of MMDDYYYY.
Mode Value The most frequently used (popular) value in the interval.
Note: This information is about the column as a whole. This is also known as
interval 0 data.
Number of
Highest Mode
Frequency
Displays the highest number of occurrences of a value.
Number of
Distinct Values
Displays the Number of Distinct Values in the table.
Number of Rows Displays the number of rows in the table.
CPU Usage Displays the amount of CPU capacity used.
IO Usage Displays the amount of IO capacity used.
Sampled Displays whether the statistics are sampled or not.
Number of
Uniques
The number of distinct non-Mode values in the interval.
Note: This information is about the column as a whole. This is also known as
interval 0 data.
Mode Frequency Displays the number of rows having the Mode Value.
Note: This information is about the column as a whole. This is also known as
interval 0 data.
Number of Amp. Displays the number of AMPs in the connected Teradata Database.
Number of
Intervals
The number of intervals in the frequency distribution for the column/index.
The maximum number of intervals for Teradata Database version12.0 is 200.
For Teradata Databases versions earlier than 12.0, the maximum number of
intervals is 100.
One AMP Sample
Est
Displays one AMP sampling estimate of the table cardinality during statistics
collection.
All AMP Sample
Est
Displays all AMP sampling estimate of the table cardinality during statistics
collection.
SysUpdateCnt Displays the Update Use Count of the objects.
SysDeleteCnt Displays the Delete Use Count of the objects.
SysInsertCnt Displays the Insert Use Count of the objects.
Note: The following values are displayed in the spreadsheet for the selected tab: Biased Values and Frequencies.
Group/Option Option Description
Chapter 6: Managing Statistics
Displaying and Modifying the Interval Statistics for a Column or Index
104 Teradata Statistics Wizard User Guide, Release 14.10
Note: It is not recommended, but interval data can be modified and submitted back to the
Teradata Database.
3 To quickly define the same values for multiple intervals, in a range or random intervals
click Add/Modify Intervalsotherwise, enter the values directly into the controls. For more
information, see Entering Statistics for Multiple Intervals on page 109.
4 To submit the values back to the Teradata Database, click Apply Modifications. This
updates the selected table or column with the interval values entered.
History of Summary
Click History of Summary to display the following History of Summary screen.
Note: History of Summary information is available only when connected to database version
14.10 or later.
Biased Value The most frequently used biased value in the interval.
Biased Value Frequency The number of rows having the Biased value.
Note: The following values are displayed in the spreadsheet for the selected tab: Equal Height Intervals
Mode Value The most frequently used value in the interval.
Max Value The highest value in the interval.
Mode Frequency The number of rows having the Mode Value.
LowFrequency The number of rows of a distinct value having lowest frequency in an equal-
height interval.
Note: For high-biased intervals, NA/zero is written as a place holder.
Non-Modal Value The number of distinct non-modal values (values that are not the most
frequently used) in the interval.
Note: If the Non-Modal Value is -1, it means there is one loner in the interval.
If the Non-Modal Value is -2, it means there are two loners in the interval.
To learn more about loner values, see Loner Values on page 106. Also refer to
SQL Request and Transaction Processing. This book contains information on
loner values and interval histograms.
Non-Modal Rows The total number of rows for all Non-Modal values in the interval.
Group/Option Option Description
Chapter 6: Managing Statistics
Displaying and Modifying the Interval Statistics for a Column or Index
Teradata Statistics Wizard User Guide, Release 14.10 105
Figure 48: HIstory of Summary
Table 30: History of Summary Options
Group/Option Option Description
Statistics Information Database Displays the name of the database where the table
exists.
Table Name Displays the name of the table where the column
exists.
Column Name Displays the name of the column associated with
the interval statistics.
Number of Records Displays the number of records the Statistics
collected for the column.
Chapter 6: Managing Statistics
Displaying and Modifying the Interval Statistics for a Column or Index
106 Teradata Statistics Wizard User Guide, Release 14.10
Loner Values
A loner is a value that has a frequency greater than the total number of table rows divided by
the maximum interval times 2.
Rows displaying loner values are highlighted and listed in the table before non-loner values. A
maximum of two loner values can be stored in each interval.
For example, if there are 10 loner values, the first five intervals are used to store them.
A -1 in the Non-Modal Valuecolumn means there is one loner value stored in the
interval.
The loner value is stored in the Mode Valuecolumn and the loner frequency is stored in the
Mode Frequencycolumn.
A -2 in the Non-Modal Valuecolumn means there are two loner values stored in the
interval.
The first loner value is stored in the Mode Valuecolumn.
The first loner frequency is stored in the Mode Frequencycolumn.
The second loner value is stored in the Max Valuecolumn.
The second loner frequency is stored in the Non-Modal Rows column.
For more information on loner values, refer to SQL Request and Transaction Processing. This
book contains information on Interval Histograms and loner values.
Column Partition Statistics Data
Use the Column Partition Statistics Data screen to define statistics for column partitioning
intervals.
Summary Records TimeStamp Displays the current TimeStamp of when the
Statistics were collected for the column.
Number of History
Records
Displays the number of History records that the
Statistics collected for the column.
AvgEHDeviation Displays the Average Equal Height Deviation.
Note: The remaining Option information is in the
Interval Statistics description table.
Table 30: History of Summary Options (continued)
Group/Option Option Description
Chapter 6: Managing Statistics
Displaying and Modifying the Interval Statistics for a Column or Index
Teradata Statistics Wizard User Guide, Release 14.10 107
Figure 49: Column Partition Data
Group/Option Option Description
Statistics Information Database Displays the name of database where the table exists.
Table Name Displays the name of table where the column exists.
Column Name Displays the name of column associated with the interval statistics.
TimeStamp Displays the TimeStamp when Statistics are collected for a column.
Version For internal use.
Summary Information Original Version Displays the Current Statistic Version.
DBS Version Displays the Database version.
UsageType Displays the Usage type of the statistics. Valued values are S for Summary
mode and D for Detailed mode.
Complex Stat
Information
Displays the information for Statistics on Complex Types such as
Geospatial.
NumOfCPPartitions Displays the Number of Column Partitions for a Column Partition table.
Number of EH
Intervals
Displays the Number of EH Intervals.
Chapter 6: Managing Statistics
Displaying and Modifying the Interval Statistics for a Column or Index
108 Teradata Statistics Wizard User Guide, Release 14.10
Number of History
Records
Displays the Number of History Records.
Number of History
Records
Displays the Number of History Records.
MinimumPartition
Number
Displays the minimum number of partitions for a Column Partition table.
MaximumPartition
Number
Displays the maximum number of partitions for a Column Partition table.
Mode Partition The most frequently used partition for a Column Partition table.
CompressionRatio Displays the number of rows in a Column Partition table.
Number of Distinct
Values
Displays the number of Distinct Values in the table.
Number of Rows Displays the number of rows in the table.
Note: The following values are displayed in the spreadsheet for the selected tab (Column
PartitionNumber and CP CompressionRatio).
CP PartitionNumber Displays each partition number for a Column Partition table.
CP Compression Ratio The number of rows for each partition.
Note: The following values are displayed in the spreadsheet for the selected tab (Equal Height
Intervals).
Mode Value The most frequently used value in the interval.
Max Value The highest value in the interval.
Mode Frequency The number of rows containing the Mode Value.
LowFrequency The number of rows of a distinct value having the lowest frequency in an
equalheightinterval.
Note: For High based interval, NA/zero is written as a place holder.
Non-Modal Value The number od distinct non-modal values (values that are not the most
frequently used) in the interval.
Note: If the non-modal value is -1, it means there is one loner in the
interval. If the non-modal value is -2, it means there are two loners in the
interval.
To learn more about loner values, see Loner Values on page 106. Also
refer to SQL Request and Transaction Processing. This book contains
information on loner values and interval histograms.
Non-Modal Rows The total number of rows for all Non-Modal values in the interval.
Group/Option Option Description
Chapter 6: Managing Statistics
Displaying and Modifying the Interval Statistics for a Column or Index
Teradata Statistics Wizard User Guide, Release 14.10 109
Entering Statistics for Multiple Intervals
Use the Add/Modifydialog box to easily define statistics for multiple intervals.
To enter statistics for multiple intervals
1 Double-click in a column or index in the Column/Indexpane.
The Interval Statisticsdialog box appears.
2 Click Add/Modify Intervals.
The Add/Modify Intervals dialog box appears .
Figure 50: Add/Modify Intervals Screen
3 To modify statistics for a range of intervals select Define Range of Intervalsand proceed to
step 4. To modify statistics for random intervals select Define RandomIntervalsand
proceed to step 5.
4 Define the interval range by clicking the arrows in the From Interval and To Interval boxes
to set the range of row numbers (from 1 to 200 for Teradata Database versions 12.0 or
higher. Up to 100 for Teradata Database versions earlier than 12.0) that statistics for the
interval will start and stop. Proceed to step 6.
Note: The interval entered in the FromInterval box is between 1 to n where n is the total
number of intervals, displayed in Number of Intervals box in the Interval Statistics dialog
box.
Chapter 6: Managing Statistics
Displaying and Modifying the Interval Statistics for a Column or Index
110 Teradata Statistics Wizard User Guide, Release 14.10
5 Type the random intervals numbers separated by commas and in ascending order in the
Enter Intervals separated by commas in ascending order box. For example, to add or
modify intervals 5, 7, 95 and 53, type 5,7,53,95 in the box. Proceed to step 6.
Note: The entered intervals are between 1 to n where n is the total number of intervals,
displayed in Number of Intervals box in the Interval Statistics dialog box.
6 Using the following table, enter or edit values and proceed to step 7.
Note: The following values are displayed in the spreadsheet for the selected tab: Biased
Values and Frequencies.
Note: The following values are displayed in the spreadsheet for the selected tab: Equal
Height Intervals.
The following options are the same for Biased Values and Frequenciesand for Equal
Height Intervalswhen using Teradata Database versions earlier than 14.0.
7 Click OKto accept the values entered in step 6 or click Cancel to close the dialog box and
return to the Interval Statistics Viewdialog box.
Clicking OKwill update the Interval Statistics Viewdialog box with the entered values.
8 Click Apply Modifications in the Interval Statistics VLiewdialog box to submit the values
back to the Teradata Database.
Option Description
Biased Value The most frequently used biased value in the interval.
Biased Value
Frequency
The number of rows having the biased value in the interval.
Option Description
Mode Value The most frequently used value in the interval.
Max Value The highest value in the interval
Mode Frequency The number of rows having the mode value in the interval.
LowFrequency The number of rows of a distinct value having lowest frequency in an
equalheightinterval.
Note: For high biased interval, NA/zero is written as a place.
Non-Modal Value The number of distinct non-modal values in the interval.
Non-Modal Rows The total number of rows for all the non-modal values in the interval.
Teradata Statistics Wizard User Guide, Release 14.10 111
Glossary
A
Access Module Processor (AMP) A virtual processor that receives steps from a parsing
engine (PE) and performs database functions to retrieve or update data. Each AMP is
associated with one virtual disk, where the data is stored. An AMP manages only its own
virtual disk and not the virtual disk of any other AMP.
administrator A special user responsible for allocating resources to a community of users.
C
cardinality In set theory, cardinality refers to the number of members in the set. When
specifically applied to database theory, the cardinality of a table refers to the number of rows
contained in a table.
Call-Level Interface (CLI) A programming interface designed to support SQL access to
databases from shrink-wrapped application programs. SQL/CLI provides and international
standard implementation-independent CLI to access SQL databases. Client-server tools can
easily access database through dynamic link libraries. It supports and encourages a rich set of
client-server tools.
Call-Level Interface Version 2 (CLIv2) Also called CLI for Windows.
column In the relational model of Teradata SQL, databases consist of one or more tables. In
turn, each table consists of fields, organized into one or more columns by zero or more rows.
All of the fields of a given column share the same attributes.
cost This is the outlay of database resources used by a given query.
current perm Amount of permanent disk space, in bytes, currently used by a table. Also see
peak perm.
D
data definition The statements and facilities that manipulate database structures and the
Data Dictionary information kept about these structures. These statements include CREATE,
DROP, ALTER, and MODIFY.
Data Definition Language (DDL) In Teradata SQL, the statements and facilities that
manipulate database structures (such as CREATE, MODIFY, DROP, GRANT, REVOKE, and
GIVE) and the dictionary information kept about those structures. In the typical, pre-
relational data management system, data definition and data manipulation facilities are
separated, and the data definition facilities are less flexible and more difficult to use than in a
relational system.
Glossary
112 Teradata Statistics Wizard User Guide, Release 14.10
database A related set of tables that share a common space allocation and owner. A
collection of objects that provide a logical grouping for information. The objects include,
tables, views, macros, triggers, and stored procedures.
Database Query Log (DBQL) A set of measures that can be analyzed over a period of time
to verify system usage or to more closely examine a query that uses a large amount of valuable
system resources.
DBA Acronym for Database Administrator.
H
heuristics Statistics recommendations, based on general rules of thumb.
histogram See interval histogram.
I
import This refers to the process of pulling system information into a program. To add
system information from an external source to another system. The system receiving the data
must support the internal format or structure of the data.
interval histogram Interval histograms are a form of synopsis data structure. A synopsis
data structure is a data structure that is substantially smaller than the base data it represents.
Interval histograms provide a useful statistical profile of attribute values that characterize the
properties of that raw data. The Teradata Database uses interval histograms to represent the
cardinalities and certain other statistical values and demographics of columns and indexes for
all-AMPs sampled statistics and for full-table statistics. Each histogram is composed of a
maximum of 100 intervals.
J
join A select operation that combines information from two or more tables to produce a
result.
L
loner value A value that has a frequency greater than the total number of table rows divided
by the maximum interval times 2. For more information, see Loner Values on page 106.
N
null The absence of a value for a field.
O
object definition This is the details of the structure and instances of the objects used by a
given query. Object definitions are used to create the tables, views, and macros, triggers, join
indexes, and stored procedures in a database.
Glossary
Teradata Statistics Wizard User Guide, Release 14.10 113
P
Partitioned Primary Index (PPI) One of four primary index types the Teradata Database
provides. A partitioned index assigns rows to a particular partition within an AMP based on a
user-defined partitioning expression. Only primary indexes can be partitioned. Any index
other than a partitioned primary index is, by default, a nonpartitioned index. PPIs are defined
for tables that are frequent targets of range or partition-based queries. A common example of
this is queries that involve date ranges.
Parsing Engine (PE) An instance (virtual processor) of the database management session
control, parsing, and dispatching processes and their data context (caches).
peak perm Highest amount of permanent disk space, in bytes, used by a table. Also see
current perm.
perm See current perm and peak perm.
privilege In Teradata SQL, a users right to perform the Teradata SQL statements granted to
him against a table, database, user, macro, or view. Also known as access right.
production system A Teradata Database used in a live environment at a customer site. A
system that is actively used for day to day business operations. This differs from a test or
development system that is used to create new queries or test new features before using them
on the production system.
Q
query A Teradata SQL statement, such as a SELECT statement.
Query Capture Database (QCD) A database of relational tables that store the steps of any
query plan captured by the Query Capture Facility (QCF).
Query Capture Facility (QCF) Provides a method to capture and store the steps from any
query plan in a set of predefined relational tables called the Query Capture Database (QCD).
R
random AMP sample An arbitrary sample from an Access Module Processor (AMP). These
are samples of the tables in a query or all of the tables in a given database.
request In host software, a message sent from an application program to the Teradata
Database.
result The information returned to the user to satisfy a request made of the Teradata
Database.
S
session In client software, a logical connection between an application program on a host
and the Teradata Database. It permits the application program to send one request to and
receive one response from the Teradata Database at a time.
Glossary
114 Teradata Statistics Wizard User Guide, Release 14.10
SQL See Structured Query Language (SQL).
statement A request for processing by the Teradata Database that consists of a keyword verb,
optional phrases, and operands. It is processed as a single entity.
statistics These are the details of the processes used to collect, analyze, and transform the
database objects used by a given query.
stored procedure Combinations of procedural and non-procedural statements run using a
single call statement.
Structured Query Language (SQL) The initialism, SQL, is pronounced either see-kwell or
as separate letters. SQL is a standardized query language for requesting information from a
database. SQL consists of a set of facilities for defining, manipulating, and controlling data in
a relational database.
T
table A two-dimensional structure made up of one or more columns with zero or more
rows that consist of fields of related information. See also database.
Target Level Emulation (TLE) Permits you to emulate a target environment (target system)
by capturing system-level information from that environment. The captured information is
stored in the relational table SystemFE.Opt_Cost_Table. The information in this table can be
used on a test system with the appropriate column and indexes to make the Optimizer
generate query plans as if it were operating in the target system rather than the test system.
target system A Teradata Database from which you export Optimizer-specific information
for modeling on a second, test system.
Teradata SET Acronym for Teradata System Emulation Tool
test system A Teradata Database where you want to import Optimizer-specific information
to emulate a target system and create new queries or test new features.
U
user A person associated with a database on the Teradata Database. The database stores the
persons private information and accesses other Teradata Databases.
Unicode, UTF-8, and UTF-16 character sets UTF-8 and UTF-16 are two of the standard
ways of encoding Unicode character data. The Teradata Database supports UTF-8 and UTF-
16 client character sets. The UTF-8 client character set supports UTF-8 encoding. The
Teradata Database supports UTF-8 characters that can consist of from one to three bytes. The
UTF-16 client character set supports UTF-16 encoding. The Teradata Database supports the
Unicode 6.0 standard, where each defined character requires exactly 16 bits. There are
restrictions imposed by the Teradata Database on using the UTF-8 and UTF-16 character sets.
For details, see International Character Set Support (B035-1125).
UnicodeStandard A standard that represents text by specifying a unique number for
every character, no matter what the platform, program, or language.
Teradata Statistics Wizard User Guide, Release 14.10 115
Index
A
About command 28
About Teradata Statistics Wizard dialog box 29
Access Count column
Column/Index pane 90
Table pane 87
acronyms 111
Add Workload Statements dialog box 59
Add/Modify Intervals dialog box 109
Age of Collection 85
icon 87
option, enabling 31
analyzing
reports
statistical 65
Statistics Recommendation 67
Table Scan 69
Table Usage 68
Update Frequency 67
Workload Analysis 70
statistics 43
applying recommendations 63
Arrange Icons command 28
ASCII 39
C
Cascade command 28
changing
display options 28
font 25
character sets
setting 39
UTF-16 114
UTF-8 114
Clear command 25
CLIv2
connecting to a database 39
collecting statistics
at the Column Level 97
options for 98
Column Name column 90
Column pane
column descriptions 90
overview 23
commands
About 28
Arrange Icons 28
Cascade 28
Clear 25
Collect Statistics 26
Connect 24
Copy 24
Create Workload 26
Current Workload Reports 26
Cut 24
Disconnect 24
Drop Statistics
Current Table 27
Selected Items 27
Execute/Schedule Recommendations 26
Exit 24
Find 24
Help Topics 28
Load Recommendation from File 26
Load Recommendations from QCD Validation 26
New 25
New Analysis 26
Paste 24
Print 24
Print Setup 24
Refresh 25, 28
Replace 24
Restart Analysis 26
Retrieve All Existing Recommendations 27
Retrieve Tables in All Databases 27
Retrieve/Collect Selected Recommendations 27
Save As 24
Select Workload Reports 26
Status Bar 25
Submit for Deferred Execution 25
Tables in All Databases 27
Tile 28
Toolbar 25
Turn Record ON 25
Undo 24
Update Existing Workload 26
Using Help 28
Connect command 24
Connect to Teradata Database dialog box 39
connecting
database, to a 38, 39
Connectivity Tab 30
Copy command 24
Index
116 Teradata Statistics Wizard User Guide, Release 14.10
Copy Statistics 95
copyright information 29
Create from Existing Workload dialog box 58
Create Workload command 26
creating
scripts, deferred execution 99
workloads 44
Creating Restricted Views 34
Current Perm column 86
Current Workload Reports command 26
Cut command 24
D
database pane, description and location 22
database, connecting to a 38, 39
Date column 90
deferred execution 99
Define Workload from DBQL Statements dialog box 45
Define Workload from QCD Statements dialog box 52
Define Workload using Statements dialog box 49
defining workloads
from DBQL statements 45
from existing workloads 58
from QCD statements 52
overview 43
using statement text 49
definitions
DBQL statements 44
errors 61
Import Workload 44
QCD statements 44
statement text 44
Use Existing Workload 44
Deselect All option 88, 89
Disconnect command 24
documentation
Messages (errors) 7
Teradata SQL Assistant User Guide 7
Drop Statistics for Current Table command 27
Drop Statistics for Selected Items command 27
drop statistics, how to 98
E
Earliest Collection column 86
Edit menu 24
Enable Table Level Statistics for All Databases option 31
enable tables in all databases 35
error log
view 42
error messages
documentation 7
errors
defining workload 61
documentation 7
log file location 61
Execute recommendations option 90
Execute/Schedule Recommendations command 26
Execute/Schedule Recommendations dialog box 63
Execution Results dialog box 64
Exit command 24
F
features
data retrieval 73
non-workload recommendations 73
tools menu 26
File menu 24
Find command 24
Find dialog box 41
frequency
loner value 106
QCD statements 53
SQL statements 50
G
General Heuristics option 32, 85, 87
General Tab 30
Get Statistics Recommendations command 27
H
Help menu 28
Help Topics command 28
History of Summary 104
I
icons, recommendations 87
Import Workload dialog box 54
importing workloads 54
Index No column 90
Index pane
column descriptions 90
overview 23
Index Type column 90
interval statistics 100
define 104
display 100
loner value 106
modify 100
options 97
J
Join Index Table column 86
Index
Teradata Statistics Wizard User Guide, Release 14.10 117
K
KANJISJIS_OS 39
L
Last Access column
Column/Index pane 90
Table pane 87
Latest Collection column 86
Latest Stats Row column 86
Load Recommendation from File command 26
Load Recommendations from QCD Validation command 26
log file location, errors 61
loner value, frequency 106
M
menu bar 23
menus
Edit 24
File 24
Help 28
Options 30
Script 25
Tools 26
View 25
Window 28
Workload Statistics 26
Messages, see documentation 7
modifying
display options 28
font 25
Multi-Columns from Selected, Collect Statistics command 26
Multi-Columns Sampled from Selected command 27
N
New Analysis command 26
New command 25
O
ODBC
connecting to a database 38
online help 18
options 84
arbitrary statistics 97
collecting statistics 98
connectivity 30
data retrieval 86
Deselect All 88, 89
dropping statistics 98
Enable Table Level Statistics for all Databases 31
Execute recommendations 90
General Heuristics 32, 87
interval statistics 97
re-collecting statistics 98
recommendations
Age of Collection 85
execute 88
General Heuristics 85
Retrieve All Existing Recommendations 88
Retrieve/Collect Recommendations (Selected) 88
schedule 88
Table Growth 85
Table Skew 84
view 88
Schedule recommendations 91
Select All 88, 89
statistics recommendations 84
Table Growth 32, 87
table pane 35, 85
retrieve perm space for all tables 35
retrieve statistics for all tables 35
Table Skew 32, 87
tools 73
use X views (DBC and QCD) 33
use X views (QCD only) 33
user options, setting 97
Options dialog box 30
connectivity tab 30
general tab 31
recommendations tab 31
table pane tab 35
Options menu 30
P
pane
column 23, 90
database 22
index 23, 90
table 22, 86
partition statistics 99
partitioned tables
collection recommendations 85
recommendation icon 87
setting option for 32
Paste command 24
Peak Perm column 86
Percent Sampled column 90
Please Select a Data Source dialog box 38
Print command 24
Print Setup command 24
product version numbers 3, 29
Q
QCD
statements 44, 53
Index
118 Teradata Statistics Wizard User Guide, Release 14.10
R
RAS level 56
re-collecting statistics options 98
recommendations
applying 63
collection 84
execute 88
column/index pane 90
table dialog box 90
icons 87
options 84
re-collection 85
schedule 88, 91
statistics collection 84
statistics re-collection 85
validating 43
view 89
Recommendations Tab 31
Refresh command 25, 28
Replace command 24
reports 66
displaying 71
selecting 65
statistics analysis 65
Statistics Recommendation 67
Table Scan 69
Table Usage 68
Update Frequency 67
viewing 71
Workload Analysis 70
Restart Analysis command 26
Restricted Views 34
Retrieve All Existing Recommendations command 27
Retrieve All Existing Recommendations option 88
retrieve perm space for all tables 35, 86
retrieve row counts for all tables 86
Retrieve Tables in All Databases command 27
Retrieve/Collect Recommendations (Selected) option 88
Retrieve/Collect Selected Recommendations command 27
retrieving statistics 40
S
Save As command 24
schedule
recommendations 91
Schedule recommendations option 91
Script menu 25
scripts, creating for deferred execution 99
Select a File to Import Workload dialog box 54
Select All option 88, 89
Select Users and Accounts 47
Select Workload Reports command 26
selecting reports 65
session character set, setting 39
set costs 56
Single Column for Selected, Collect Statistics command 26
Single Column Sampled for Selected, Collect Statistics
command 26
Skew % column 86
software releases
supported 3
SQL statements 50
Stat Rows column 90
statement text 44
statements
add 60
defining
from existing workload 58, 60
from QCD statements 52
set RAS level 56
set TLE 56
using statement text 49
definitions 44
DBQL statements 44
SQL 50
statistics
analysis reports 65
analyzing 43
applying recommendations 63
collect 97
column level 97
multiple columns from selected 98
multiple columns sampled 98
single column 97
single column sampled 98
collection recommendations
Age of Collection 85
General Heuristics 85
Retrieve All Existing Recommendations 88
Retrieve/Collect Recommendations (Selected) 88
Table Growth 85
Table Skew 84
interval 97
column/index 100
define 104
loner value 106
multiple intervals, entering for 109
options
Deselect All 88, 89
Execute recommendations 90
Select All 88, 89
re-collect, column level 97
re-collection recommendations 85
recommendations 84
execute 90
icons 87
schedule 91
Index
Teradata Statistics Wizard User Guide, Release 14.10 119
view 89
reports 65
retrieving 40
validating 43
Statistics Recommendation report 67
Statistics Recommendations dialog box 63
Status Bar command 25
Submit for Deferred Execution command 25
T
Table Growth option 32, 85, 87
table growth recommendations 35, 86
Table Level for Selected/Current command 27
Table Level Statistics for all Databases command 27
Table Name column 86
table pane
column descriptions 86
description and location 22
options 85
table pane options
enable tables in all databases 35
retrieve perm space for all tables 35
retrieve statistics for all tables 35
Table Pane Tab 35
Table Scan report 69
Table Skew option 32, 84, 87
table skew recommendations 35, 86
Table Usage report 68
Tables in All Databases command 27
Teradata Database Connect dialog box 38
Teradata SQL Assistant
documentation 7
Tile command 28
Time column 90
toolbar
default toolbar 23
workload 36
Toolbar command 25
Tools menu 26, 85
Total # of Rows column 86
Turn Record ON command 25
U
Undo command 24
Unicode 114
Unique column 90
Unique Vals column 90
Update Existing Workload command 26
Update Frequency report 67
updating existing workloads 61
user options
collection recommendations 84
data retrieval 73
non-workload 73
recommendations 73
Using Help command 28
UTF-16 character sets 39, 114
UTF-8 character sets 39, 114
V
validating
recommendations 43
statistics 43
version numbers 3
Teradata Statistics Wizard 29
view
error log 42
View menu 25
View Reports dialog box 71
W
Window menu 28
Workload Analysis report 70
Workload Clean Up dialog box 62
Workload Definition Summary dialog box 44
workload definitions
DBQL statements 44
import workload 44
QCD statements 44
use existing workload 44
Workload Statistics menu 26
Workload Tab 33
workload toolbar 36
workloads
cleanup 62
creating 44
defining 43, 44
DBQL statements, from 45
existing workload, from 58, 60
QCD statements, defining from 52
set RAS level 56
set TLE 56
statement text, using 49
definition errors 61
importing 54
statements, displaying 56
updating 61
Index
120 Teradata Statistics Wizard User Guide, Release 14.10

Вам также может понравиться