You are on page 1of 154

Teradata Index Wizard

User Guide

Release 01.03.00 B035-2506-115A November 2005

The product described in this book is a licensed product of Teradata, a division of NCR Corporation. NCR, Teradata and BYNET are registered trademarks of NCR Corporation. Adaptec and SCSISelect are registered trademarks of Adaptec, Inc. EMC, PowerPath, SRDF, and Symmetrix are registered trademarks of EMC Corporation. Engenio is a trademark of Engenio Information Technologies, Inc. Ethernet is a trademark of Xerox Corporation. GoldenGate is a trademark of GoldenGate Software, Inc. Hewlett-Packard and HP are registered trademarks of Hewlett-Packard Company. IBM, CICS, DB2, MVS, RACF, OS/390, Tivoli, and VM are registered trademarks of International Business Machines Corporation. Intel, Pentium, and XEON are registered trademarks of Intel Corporation. KBMS is a registered trademark of Trinzic Corporation. Linux is a registered trademark of Linus Torvalds. LSI, SYM, and SYMplicity are registered trademarks of LSI Logic Corporation. Active Directory, Microsoft, Windows, Windows Server, and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Novell is a registered trademark of Novell, Inc., in the United States and other countries. SUSE is a trademark of SUSE LINUX Products GmbH, a Novell business. QLogic and SANbox are registered trademarks of QLogic Corporation. SAS and SAS/C are registered trademark of SAS Institute Inc. Sun Microsystems, Sun Java, Solaris, SPARC, and Sun are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. or other countries. Unicode is a registered trademark of Unicode, Inc. UNIX is a registered trademark of The Open Group in the US and other countries. NetVault is a trademark and BakBone is a registered trademark of BakBone Software, Inc. NetBackup and VERITAS are trademarks of VERITAS Software Corporation. 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 NONINFRINGEMENT. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION MAY NOT APPLY TO YOU. IN NO EVENT WILL NCR CORPORATION (NCR) 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 NCR intends to announce such features, functions, products, or services in your country. Please consult your local NCR 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. NCR 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 e-mail: teradata-books@lists.ncr.com Any comments or materials (collectively referred to as Feedback) sent to NCR will be deemed non-confidential. NCR 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, NCR 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-2005 by NCR Corporation. All Rights Reserved.

Preface
Purpose
The Teradata Tools and Utilities are a group of products designed to work with the Teradata Database. This book provides information on Teradata Index Wizard, which allows a database administrator to create or identify a workload, perform index analysis for a workload, and verify and apply index recommendations to increase database efficiency and maximize system performance. This book includes an overview of the product and its components, and it describes the operational functions and features of the product.

Audience
This book is intended for: System and application programmers System administrators Database administrators and relational database developers System operators and other database specialists

Supported Releases
This book applies to the following releases: Teradata Database V2R6.1 Teradata Tools and Utilities 08.01.00 Teradata Index Wizard 01.03.00

To find out on which platforms a given product is available and the compatible Teradata Database versions, refer to Teradata Tools and Utilities 08.01.00 Supported and Certified Versions, B035-3119-115K. This spreadsheet shows version numbers and platform information for all Teradata Tools and Utilities release 08.01.00 products and is available at www.info.ncr.com.

Teradata Index Wizard User Guide

iii

Preface Prerequisites

Prerequisites
You should be familiar with the following: Relational database management systems SQL and Teradata SQL Basic concepts and facilities of the Teradata Database Connectivity software, such as ODBC or CLI

Changes to This Book


The following changes were made to this book to support the current release and are marked with change bars:
Date/Release November 2005 01.03.00 Description Added support for single table join index recommendations. See Table 32 on page 56. Redesigned the graphical user interface for the What-If Analysis. See What-if Analysis on page 61. Added a new option for index maintenance mode feature. See Table 32 on page 56. Also added a command line option for specifying index maintenance mode. See Table 74 on page 117. Added support for the new Cost Profiles feature. See Table 24 on page 42 and Table 25 on page 43. Added a new Index Maintenance Cost Report. See Index Maintenance Cost Report on page 86. Changed the name from Update Cost Analysis Report to Update Frequency Report. See Update Frequency Report on page 79. Added support for using Unicode character data including support for UTF-8 and UTF-16 character sets in accordance with the current Teradata Database release. See Table 13 on page 19 and Unicode, UTF-8, and UTF-16 character sets on page 126. Also added a command line option for specifying session character sets. See Table 72 on page 116. Changed names of dialog boxes related to ODBC to support NCR corporate branding requirements. See Connecting Through ODBC on page 18. Added context sensitive Help to all reports. Throughout guide, changed the term Teradata RDBMS to Teradata Database to support NCR corporate branding requirements. Updated version and copyright notices.

iv

Teradata Index Wizard User Guide

Preface Additional Information

Date/Release November 2004 01.02.00

Description When defining a workload using DBQL statements, start and end time fields are now separated to make them easier to use. Added two options for handling errors when defining a workload. Added information to disable access logging before running an index analysis. To schedule recommendations, Teradata Index Wizard interfaces to Teradata Query Scheduler instead of Teradata DQM. Enhanced version and copyright information. Support for extended security. To support NCR corporate branding requirements, changed the term Teradata RDBMS to Teradata Database where possible. Improved format and layout consistency throughout the book.

September 2003 01.01.00

Updated the introduction chapter with new information about the Teradata Analyst Pack. Expanded on how Index Wizard works with the other analysis tools. Reports section rewritten to add additional information. Updated the Demographics section. Support added for Object User Count in reports. Added preference setting for demographics clause. Row Estimate column to the Index Analysis report. Right click popup features documented. Use Count added to Execute and Schedule dialogs. Added new information regarding error handling while importing a workload.

December 2002 01.00.00

Created user guide.

Additional Information
Additional information that supports this product and the Teradata Tools and Utilities is available at the following Web sites. In the following table, mmyx represents the publication date of a manual, where mm is the month, y is the last digit of the year, and x is an internal publication code.

Teradata Index Wizard User Guide

Preface Additional Information

Type of Information Overview of the release Information too late for the manuals

Description The Release Definition provides the following information: Overview of all 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 support center Use the NCR Information Products Publishing Library site to view or download, the most recent versions of all manuals. Specific manuals that supply related or additional information to this manual are listed.

Source http://www.info.ncr.com/ Navigate to General Search > Publication Product ID, and enter 2029 to bring up the following Release Definition: Teradata Tools and Utilities Release Definition B035-2029-mmyx

Additional information related to this product

http://www.info.ncr.com/ Click General Search, and do one of the following: In the Product Line field, select Software Teradata Tools and Utilities (TTU) for a list of all of the publications for this release, In the Publication Product ID field, enter one of the following book numbers: Messages B035-1096-mmyx ODBC Driver for Teradata User Guide B035-2509-mmyx SQL Reference: Data Definition Statementse B035-1144-mmyx Teradata Query Scheduler Administrator Guide B035-2496-mmyx Teradata Query Scheduler User Guide B035-2497-mmyx Teradata SQL Assistant for Microsoft Windows User Guide B035-2430-mmyx Teradata Statistics Wizard User Guide B035-2503-mmyx Teradata System Emulation Tool User Guide B035-2492-mmyx Teradata Visual Explain User Guide B035-2504-mmyx http://www.info.ncr.com/ Navigate to General Search > Title or Keyword, and enter CD-ROM.

CD-ROM images

This site contains 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.

vi

Teradata Index Wizard User Guide

Preface Additional Information

Type of Information Ordering information for manuals General information about Teradata

Description Use the NCR Information Products Publishing Library site to order printed versions of manuals. 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

Source http://www.info.ncr.com/ Click How to Order under Print & CD Publications. Teradata.com

Teradata Index Wizard User Guide

vii

Preface Additional Information

viii

Teradata Index Wizard User Guide

Table of Contents

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii Supported Releases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv Changes to This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv Additional Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .v

Chapter 1: Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
How Teradata Index Wizard Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 Index Wizard Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 Teradata Analyst Pack. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Ways the Analyst Pack Tools Work Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 How Index Wizard Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6 Using Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6

Chapter 2: Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7
File Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8 View Menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8 Workload Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9 Analysis Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Reports Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Validation Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Creation Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Tools Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Windows Menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Help Menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Version and Copyright Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

Teradata Index Wizard User Guide

ix

Table of Contents

Status Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 Shortcut Menus. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15

Chapter 3: Using Index Wizard-Quick Start. . . . . . . . . . . . . . . . . . . . . .17


Launching Teradata Index Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 Selecting a Logon Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18 Connecting Through ODBC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18 Connecting Through WinCLI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 Connection Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 Defining a Workload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 Running an Index Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 Selecting Reports. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 Validating Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 Validation Results Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 Executing Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25

Chapter 4: Defining a Workload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27


Using DBQL Statements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 Using SQL Statement Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 Selecting SQL Statements from the QCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34 Errors While Defining a Workload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 Importing a Workload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 Setting the TLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 Handling Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41 Import Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 Creating a New Workload from an Existing Workload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44 Adding Additional Workload Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 Updating an Existing Workload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46 Add Statements Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48 Additional Workload Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49 Workload Cleanup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 Viewing Workload Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51 Workload Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 Displaying Statement Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52

Teradata Index Wizard User Guide

Table of Contents

Chapter 5: Index Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53


Performing a New Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Advanced Index Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Index Analysis Summary Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Restarting an Analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 What-if Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . View Details Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Advanced Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Statistics Information Window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What-if Analysis Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What-if Analysis Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 65 66 68 70 72

Index Analysis Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 View Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

Chapter 6: Viewing Reports. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77


Existing Indexes Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 Update Frequency Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 Table Usage Analysis Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 Table Scan Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Workload Analysis Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Object Global Use Count Report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Index Recommendation Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Query Cost Analysis Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Disk Space Analysis Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Summary Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Index Maintenance Cost Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 Viewing Reports from Other Workloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

Chapter 7: Validating an Index Recommendation . . . . . . . . . . . . . 89


The Validation Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Loading Recommendations from QCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 Loading Recommendations from File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 Validation Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

Teradata Index Wizard User Guide

xi

Table of Contents

Chapter 8: Executing Recommendations . . . . . . . . . . . . . . . . . . . . . . . . .95


Executing a Recommendation Immediately . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95 Execution Results Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96 Schedule Recommendation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96 Schedule Recommendation Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99

Chapter 9: Index Wizard Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101


Executing SQL Feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 Working With Other Teradata Client Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103 Preferences. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103 Index Analysis Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104

Chapter 10: Data Demographics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107


Data Demographics Window Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107 The Data Demographics Menu Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108 Data Demographics Window Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109 Data Demographics Graph Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111 Disk Space Utilization Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111 Spool Space Utilization Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .112 Row Count/Avg. Row Size Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .112 Blocks Distribution Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113 Statistics Details Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113

Appendix A: Command Line Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . .115


Invoking the GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 Opening Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 Command Line Interface Syntax. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 Command Line Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116

Appendix B: Index Wizard Error Messages . . . . . . . . . . . . . . . . . . . . .119


Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119

xii

Teradata Index Wizard User Guide

Table of Contents

Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

Teradata Index Wizard User Guide

xiii

Table of Contents

xiv

Teradata Index Wizard User Guide

List of Figures

Figure 1: Index Wizard Architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 Figure 2: Index Wizard Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7 Figure 3: Status Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Figure 4: Example of a Shortcut Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Figure 5: Index Wizard Main Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Figure 6: Define Workload from DBQL Statements Dialog Box . . . . . . . . . . . . . . . . . . . . . . . 28 Figure 7: Statement Text Dialog Box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Figure 8: Select Users and Accounts Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Figure 9: Workload Definition Summary Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Figure 10: Define a Workload using Statements Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Figure 11: Define a Workload from QCD Statements Dialog Box. . . . . . . . . . . . . . . . . . . . . . 35 Figure 12: Warning Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Figure 13: Import File Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Figure 14: Set Target Level Emulation Dialog Box - Set RAS Tab . . . . . . . . . . . . . . . . . . . . . . 40 Figure 15: Error Handling Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Figure 16: Create from Existing Workload Dialog Box. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Figure 17: Update Existing Workload Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Figure 18: Workload Clean Up Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Figure 19: Index Analysis Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Figure 20: Index Analysis Parameters Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Figure 21: Index Types Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Figure 22: Index Analysis Summary Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Figure 23: Select Workload Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Figure 24: Workload Statements Report. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Figure 25: What-If Analysis: Add Index Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Figure 26: View Details Dialog Box and View Statement Dialog Box . . . . . . . . . . . . . . . . . . . 66 Figure 27: Analysis Options Dialog Box: Set Costs Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Figure 28: Analysis Options Dialog Box: Set Statistics Samples Tab . . . . . . . . . . . . . . . . . . . . 68 Figure 29: Statistics Information Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Figure 30: Analysis Results Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Figure 31: Performance Improvement Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Figure 32: Validation Results Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

Teradata Index Wizard User Guide

xv

List of Figures

Figure 33: Select Recommendations Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97 Figure 34: Schedule Recommendations Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98 Figure 35: Execute SQL - Query Window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102 Figure 36: Data Demographics Window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108 Figure 37: Navigation Controls for Table Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110

xvi

Teradata Index Wizard User Guide

List of Tables

Table 1: File Menu Commands and Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8 Table 2: File Menu Commands and Descriptions (when report is open) . . . . . . . . . . . . . . . . . .8 Table 3: View Menu Commands and Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9 Table 4: Workload Menu Commands and Descriptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Table 5: Analysis Menu Commands and Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Table 6: Reports Menu Commands and Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Table 7: Validation Menu Commands and Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Table 8: Creation Menu Commands and Descriptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Table 9: Tools Menu Commands and Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Table 10: Windows Menu Commands and Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Table 11: Help Menu Commands and Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Table 12: About Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Table 13: Connect Through WinCLI Dialog Box Description . . . . . . . . . . . . . . . . . . . . . . . . . 19 Table 14: Connection Errors Dialog Box Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Table 15: Report Buttons and Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Table 16: Define Workload from DBQL Statements Dialog Box: DBQL Search Criteria Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Table 17: Select Users and Accounts Dialog Box Description . . . . . . . . . . . . . . . . . . . . . . . . . 31 Table 18: Define Workload from DBQL Statements Dialog Box: DBQL Statements . . . . . . 31 Table 19: Define Workload Using Statements Dialog Box Description . . . . . . . . . . . . . . . . . 34 Table 20: Define Workload from QCD Statements Dialog Box Description . . . . . . . . . . . . . 35 Table 21: Warning Dialog Box Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Table 22: Importing a Workload Dialog Box Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Table 23: Set Target Level Emulation Dialog Box Description. . . . . . . . . . . . . . . . . . . . . . . . . 40 Table 24: Error Handling Dialog Box Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Table 25: Import Option Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 Table 26: Create from Existing Workload Dialog Box Description . . . . . . . . . . . . . . . . . . . . . 45 Table 27: Add Workload Statements Dialog Box Description . . . . . . . . . . . . . . . . . . . . . . . . . 46 Table 28: Update an Existing Workload Dialog Box Description . . . . . . . . . . . . . . . . . . . . . . 47 Table 29: Add Statements Option Dialog Box Description . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Table 30: Workload Details Dialog Box Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Table 31: Index Analysis Dialog Box Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

Teradata Index Wizard User Guide

xvii

List of Tables

Table 32: Index Analysis Parameters Dialog Box Description . . . . . . . . . . . . . . . . . . . . . . . . . .56 Table 33: What-If Analysis Dialog Box Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62 Table 34: What-If Analysis: Add Index Dialog Box Description . . . . . . . . . . . . . . . . . . . . . . . .64 Table 35: Analysis Options Dialog Box: Set Costs Tab Description. . . . . . . . . . . . . . . . . . . . . .66 Table 36: Analysis Options Dialog Box: Set RAS Tab Description. . . . . . . . . . . . . . . . . . . . . . .67 Table 37: Analysis Options Dialog Box: Set Statistics Samples Tab Description . . . . . . . . . . .68 Table 38: Statistics Information Window Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69 Table 39: Analysis Results Dialog Box Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 Table 40: Analysis Statistics Dialog Box Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72 Table 41: Index Analysis Summary Window Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74 Table 42: View Report Dialog Box Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75 Table 43: Existing Indexes Report Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 Table 44: Update Frequency Report Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 Table 45: Table Usage Analysis Report Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 Table 46: Table Scan Report Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 Table 47: Workload Analysis Report Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 Table 48: Object Global Use Count Report Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82 Table 49: Index Recommendation Report Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 Table 50: Query Cost Analysis Report Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84 Table 51: Disk Space Analysis Report Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85 Table 52: Summary Report Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86 Table 53: Index Maintenance Cost Report Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86 Table 54: View Report Dialog Box Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87 Table 55: Recommendations from QCD Dialog Box Description . . . . . . . . . . . . . . . . . . . . . . .90 Table 56: Index Validation Dialog Box Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91 Table 57: Validation Results Window Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93 Table 58: Execute Recommendation Dialog Box Description . . . . . . . . . . . . . . . . . . . . . . . . . .95 Table 59: Execution Results Window Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96 Table 60: Select Recommendations Dialog Box Description . . . . . . . . . . . . . . . . . . . . . . . . . . .97 Table 61: Schedule Recommendations Dialog Box Descriptions. . . . . . . . . . . . . . . . . . . . . . . .98 Table 62: Schedule Recommendation Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 Table 63: Preferences Dialog Box Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104 Table 64: Data Demographics Menu Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108 Table 65: Bar and Line Graph View Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109 Table 66: Disk Space Utilization Button Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111 Table 67: Spool Space Utilization Button Descriptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .112

xviii

Teradata Index Wizard User Guide

List of Tables

Table 68: Row Count/Average Row Size Button Descriptions . . . . . . . . . . . . . . . . . . . . . . . . 113 Table 69: Blocks Distribution Button Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 Table 70: Statistics Details Button Descriptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 Table 71: Statistics Details Graph Button Descriptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 Table 72: Command Line Options for Logon Information . . . . . . . . . . . . . . . . . . . . . . . . . . 116 Table 73: Command Line Options for Defining a Workload . . . . . . . . . . . . . . . . . . . . . . . . . 117 Table 74: Command Line Options for Inputs to the Wizard . . . . . . . . . . . . . . . . . . . . . . . . . 117 Table 75: Command Line for Specifying Output File Name . . . . . . . . . . . . . . . . . . . . . . . . . 118 Table 76: Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

Teradata Index Wizard User Guide

xix

List of Tables

xx

Teradata Index Wizard User Guide

CHAPTER 1

Introduction

Indexing is one of the most powerful tuning options available to a database designer or database administrator (DBA). Traditionally, index selection has been a complex and manual process requiring the DBA to have detailed knowledge of the application workloads and data demography of your Teradata Warehouse, as well as experience and understanding of parallel query plan optimization. As more application workloads are introduced, analyzing the impact and derived benefit of an index becomes increasingly difficult. To determine a good set of indexes, designers had to rely on their application experience and intuition. Teradata Index Wizard takes the guesswork out of indexing. Index Wizard automates index selection and creates statistical information that allows DBAs to make a fully informed index choice.

How Teradata Index Wizard Works


Teradata Index Wizard consists of a database server component and a front-end client application. The index analysis engine is inside the Teradata parser and works closely with the parallel optimizer to enumerate, simulate, and evaluate index selection candidates. The client front end is a graphical Microsoft Windows interface, providing step-by-step instructions for workload definition and index analysis, and reports for both workload and index analysis.

Index Wizard Features


The following is a description of the basic features of Index Wizard: Graphical User Interface (GUI) supported on Microsoft Windows NT/2000/XP platforms. Interfaces with the Teradata Database Query Log (DBQL) facility to define workloads from a collection of SQL statements captured in the query log. Works with other client tools including Teradata System Emulation Tool, Teradata Visual Explain, and Teradata Statistics Wizard. Imports workloads onto a test system for analysis, saving production system resources. Validates recommendations on the production system before actually creating the new set of indexes.

Teradata Index Wizard User Guide

Chapter 1: Introduction Teradata Analyst Pack

Additional Index Wizard Features


What-if analysis on a workload Allows you to perform what-if analysis on a given workload. You can play with various aspects of the index information to tweak recommendations for greater performance. For more details, see What-if Analysis on page 61. Schedule recommended indexes Allows you to schedule a recommended set of indexes for a specific date and time. This feature works with Teradata Dynamic Query Manager 5.0. For more details, see Schedule Recommendation on page 96. Index Wizard can be started from other client programs Index Wizard can be started from Teradata Visual Explain, Teradata Statistics Wizard, and Teradata Manager. Index Wizard can also open these applications (except Teradata Manager) to help in your evaluation of recommended indexes. For more information, see Working With Other Teradata Client Tools on page 103. Teradata System Emulation Tool can be used to help evaluate recommendations The workload, along with the environment of the production system, can be imported to a test system using a separate tool called Teradata System Emulation Tool. For information about this tool, see Teradata Analyst Pack on page 2. Data Demographics Window Index Wizard provides a Data Demographics window that displays the demography details of selected tables. For more details, see Chapter 10: Data Demographics. Execute SQL Window Option Index Wizard has an option that enables you to create and execute SQL statements either through Teradata SQL Assistant or through an Execute SQL-Query window in Index Wizard. For more details, see Executing SQL Feature on page 101.

Teradata Analyst Pack


Teradata Index Wizard is part of a suite of software tools called the Teradata Analyst Pack. As application environments expand to include mixed workloads for both decision support and near real time analytic processing, managing and maximizing the performance of the database becomes a more challenging task. To meet this challenge, the Teradata Analyst Pack helps information technology professionals analyze and tune their Teradata Warehouse for better performance. The Teradata Analyst Pack is targeted at query or workload-based analysis and focuses on the execution performance at the individual query level.

Teradata Index Wizard User Guide

Chapter 1: Introduction Teradata Analyst Pack

Teradata Analyst tools include: Teradata Index Wizard Teradata Statistics Wizard Teradata Visual Explain Teradata System Emulation Tool

The ability to analyze and understand the detailed steps involved in the query plan along with the influences of the system configuration, data demographics, and index structure, are the first steps in identifying opportunities to improve performance of the active data warehouse. You can open the Teradata Analyst tools noted above by clicking their respective buttons on the toolbar or selecting Tools from the menu bar and selecting the application. Note: You must install the tools to access them through Index Wizard.

Ways the Analyst Pack Tools Work Together


Identify the queries or workload to be analyzed for performance tuning. Logging onto Teradata DBQL is one easy way to selectively capture SQL queries at query run time. Capture query plans into the Query Capture Database (QCD). For individual queries or a small set of queries, use the Teradata Visual Explain Launch QCF feature. For bigger workloads, the Teradata Index Wizard Workload Definition feature can be used to define the workload and capture query plans for all queries in the workload. Optionally, export the captured query plans, system cost parameters, statistics, data demographics, random AMP samples, and object definitions from the production or target system to a test system using Teradata System Emulation Tool. This step is not necessary, but enables off loading of the analysis activities from the production to the test environment. Analyze the statistics and data demographics for the tables involved in the workload using Teradata Statistics Wizard. After analyzing the workload for statistics recommendations, they can be applied immediately. At this point, you can optionally recapture the plans for the workload and compare them using Teradata Visual Explain's query or bulk compare feature. Doing this allows you to visualize and measure the improvements achieved by implementing the Teradata Statistics Wizard recommendations. Perform index analysis for the workload using Teradata Index Wizard. In the case of analysis on a test system, the index recommendations can be validated back on the production system using the Validate Recommendations feature. This will simulate the indexes without actually creating them, and produce a query plan as though the indexes were present. Validation also collects sampled statistics as part of the process, thus ensuring up-to-date statistics are available for the proposed indexes. Analyze the output of the Teradata Index Wizard reports to understand the recommendations' impact on performance (estimated performance improvement), and cost to implement (in terms of disk space and creation time). Utilize Teradata Visual Explain to compare pre- and post-recommendation plans (post recommendation plans are automatically generated and stored for each query in the workload during Index Validation). Implement the recommendations on the production system to achieve the

Teradata Index Wizard User Guide

Chapter 1: Introduction How Index Wizard Works

performance improvement desired, or alternatively, use the what-if analysis mode to identify potential performance improvements of your own proposed secondary indexes.

How Index Wizard Works


Index Wizard works by analyzing a set of queries in a defined workload and recommending a set of secondary indexes to use. The following figure illustrates how Index Wizard works with a system.
Figure 1: Index Wizard Architecture

Client System

C L I E N T

Index Wizard

W i n C L I /

O D B C

G A T E W A Y C HD AR N I NV EE LR

Index Wizard Infrastructure

QCD

S E R V E R
2506C001

NT/2K/XP

MP RAS/Win 2K

Basic Index Wizard Steps


The following steps describe what you do:
1 2 3 4 5

Workload is defined Workload is analyzed Indexes are recommended Index recommendations are validated (optional) Index recommendations are applied to the production system

The following sections briefly explain the basic Index Wizard steps. Each section also references more detailed procedures.

Teradata Index Wizard User Guide

Chapter 1: Introduction How Index Wizard Works

Defining a Workload
A workload is a set of SQL statements created or defined using the Workload Definition dialog box. Index Wizard creates several workload reports after a workload is defined. Workloads can be defined in the following ways: Using Database Query Log (DBQL) - The Database Query Log (DBQL) provides the capability to store, in system tables, the performance-related data for a request. For more information, see Using DBQL Statements on page 27. Using Statement Text - SQL statements can be directly keyed into a workload. The SQL statements can also be selected from one or more files. For more information, see Using SQL Statement Text on page 32. From QCD Statements - An existing set of execution plans in a QCD can be selected to form a workload. The workload is created in the QCD in which the execution plans exist. For more information, see Selecting SQL Statements from the QCD on page 34. Importing Workload - Users can import workloads from other sources including other Teradata client tools. For more information, see Importing a Workload on page 37. From an Existing Workload - A new workload can be created from an existing workload. For more information, see Creating a New Workload from an Existing Workload on page 44.

Index Analysis
After the workload is defined, it is analyzed and a new set of indexes is recommended. Index Wizard may also recommend that indexes be added or dropped to enhance system performance. There are three types of analysis: New Analysis. A new analysis is performed on a workload. For more information, see Performing a New Analysis on page 53. Restarting an Analysis. If an analysis was interrupted, it can be restarted. For more information, see Restarting an Analysis on page 60. What-If Analysis. This type of analysis allows you to check your own recommendations on the workload to determine the performance benefits. For more information, see What-if Analysis on page 61. For more information on the available input settings for an index analysis, see Advanced Index Parameters on page 55.

Reports
Index Wizard creates several reports about workloads and indexes. Some reports are created when a workload is defined. Others are created when a workload is analyzed. For information on Index Wizard reports, see Chapter 6: Viewing Reports.

Teradata Index Wizard User Guide

Chapter 1: Introduction Online Help

Validating an Index
Index Wizard validates index recommendations on a production system without actually updating the production table index. This feature is optional, but highly recommended because it ensures the index recommendation will help database performance before actually adding the indexes. The execution plans obtained with the recommendation can be compared with the original query plans (those without the index recommendations) using Teradata Visual Explains Compare feature. Index Wizard interfaces with Teradata Visual Explain in providing a queryby-query compare. For information on validation, see Chapter 7: Validating an Index Recommendation.

Executing Recommendations
After an index recommendation is validated, Index Wizard allows you to apply (execute) the index to the production system. You can execute an index immediately or schedule the execution to occur at a different time and day. For details about executing recommendation and scheduling recommendations, see Chapter 8: Executing Recommendations.

Online Help
Using Online Help
Teradata Index Wizard has online Help that can help answer your questions about how to use its features. Help is opened in a browser window. Microsoft Internet Explorer, version 6.0 or later, is the recommended browser for viewing Help.

To open Help
From the toolbar, click

After the Help window is open, you can navigate to or search for other topics.

To get Help within a window or 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 Shift + F1.

Teradata Index Wizard User Guide

CHAPTER 2

Interface

The Teradata Index Wizard interface is designed to make index analysis and recommendations easy and quick. The basic interface is shown in the following figure.
Figure 2: Index Wizard Window

The interface contains the following menus and features. File Menu View Menu Workload Menu Analysis Menu Reports Menu Validation Menu Creation Menu Tools Menu Windows Menu Help Menu Status Bar Shortcut Menus

Teradata Index Wizard User Guide

Chapter 2: Interface File Menu

File Menu
Use the File menu to connect and disconnect from the Teradata Database, as well as save, print, and exit the application. The following table describes the commands on the File menu.
Table 1: File Menu Commands and Descriptions

Toolbar Menu Command Button Connect

Description Connects to the Teradata Database server. For more information, see Selecting a Logon Method on page 18. Disconnects from the Teradata Database server.

Disconnect

Exit

Closes Index Wizard.

When a report is open, the following commands appear on the File menu:
Table 2: File Menu Commands and Descriptions (when report is open)

Menu Command Save As

Toolbar Button

Description Saves the active report.

Print

Prints the active report.

Print Preview

Previews the report about to be printed.

Print Setup

Opens the Print Setup window where you can set various print options.

View Menu
Use the View menu to control the views of different application elements including the toolbar and status bar. You can also view the Workload Details window. The following table describes the commands on the View menu.

Teradata Index Wizard User Guide

Chapter 2: Interface Workload Menu

Table 3: View Menu Commands and Descriptions

Menu Command Sub Menu Toolbar> Standard Reports Status Bar> Standard Information Workload Details Analysis Summary Change Font

Toolbar Button

Description Displays and hides the Standard toolbar across the top of the window. Displays and hides the Reports toolbar on the left side (default position) of the window. Displays and hides the status bar at the bottom of the window. Displays and hides the Information bar at the bottom of the window. Displays the View Workload Details window. This window shows the information about the currently cached workload. Shows the Index Analysis Summary window. For more information, see Summary Report on page 85. Changes the font type and size on reports. This option is only available when a report is present.

Workload Menu
Use the Workload menu to control various aspects of a workload. The following table describes the commands on the Workload menu.

Teradata Index Wizard User Guide

Chapter 2: Interface Analysis Menu

Table 4: Workload Menu Commands and Descriptions

Menu Command Create >

Sub Menu From DBQL Statements Using Statements Text... From QCD Statements Import Workloads From Existing Workload

Toolbar Button

Description Selects SQL statements from the DBQL. Used to enter the SQL statements or select the statements from one or more files. Selects SQL statements from the QCD. Imports a workload from a production system using Teradata System Emulation Tool. Creates a new workload from an existing one. See for greater detail. Updates an existing workload.

For More Information Using DBQL Statements on page 27

Using SQL Statement Text on page 32 Selecting SQL Statements from the QCD on page 34 Importing a Workload on page 37

Creating a New Workload from an Existing Workload on page 44 Updating an Existing Workload on page 46 Workload Cleanup on page 50

Update Existing Workload... Workload Clean Up...

Deletes workloads that you no longer need.

Analysis Menu
Use the Analysis menu to start a new analysis or restart an existing analysis. The menu also has a what-if analysis option. The following table describes the commands on the Analysis menu.
Table 5: Analysis Menu Commands and Descriptions

Menu Command New Analysis

Toolbar Button

Description Starts a new analysis using the currently cached workload or a selected workload. Restarts an analysis that was previously halted. Start a What-if analysis of the selected workload.

For More Information Performing a New Analysis on page 53

Restart Analysis What-if Analysis...

Restarting an Analysis on page 60

What-if Analysis on page 61

10

Teradata Index Wizard User Guide

Chapter 2: Interface Reports Menu

Reports Menu
Use the Reports menu to generate various reports in Index Wizard. The following table describes the commands on the Reports menu.
Table 6: Reports Menu Commands and Descriptions

Menu Command Current Workload>

Sub Menu Index Recommendations Existing Indexes Query Cost Analysis Update Frequency Disk Space Analysis Table Usage Analysis Table Scan

Toolbar Button

Description Generates the Index Recommendations report.

For More Information, see Index Recommendation Report on page 83

Generates the Existing Indexes Existing Indexes Report on page 78 report. Generates the Query Cost Analysis report. Generates the Update Frequency report. Generates the Disk Space Analysis report. Generates the Table Usage Analysis report. Generates the Table Scan report. Generates the Workload Analysis report. Generates the Summary report. Generates the Object Global Use Count report. Generates the Index Maintenance Cost report. Selects reports from other workloads. Query Cost Analysis Report on page 83 Update Frequency Report on page 79 Disk Space Analysis Report on page 84 Table Usage Analysis Report on page 79 Table Scan Report on page 80

Workload Analysis Summary

Workload Analysis Report on page 81 Summary Report on page 85

Object Global Use Count Index Maintenance Cost Select Other Workload

Object Global Use Count Report on page 82 Index Maintenance Cost Report on page 86

Teradata Index Wizard User Guide

11

Chapter 2: Interface Validation Menu

Validation Menu
Use the Validation menu to control the validation process. The following table describes the commands on the Validation menu.
Table 7: Validation Menu Commands and Descriptions

Menu Command Load Recommendations from QCD... Load Recommendations from File...

Toolbar Button

Description Loads the recommendations to be validated from the QCD. Loads the recommendations to be validated from a file.

For More Information Loading Recommendations from QCD on page 90 Loading Recommendations from File on page 92

Creation Menu
Use the Creation menu to load recommended indexes into the production database immediately or schedule an update on a later date and time. The following table describes the commands on the Creation menu.
Table 8: Creation Menu Commands and Descriptions

Menu Command Execute Immediately

Toolbar Button

Description Executes the index recommendation immediately.

For More Information Executing a Recommendation Immediately on page 95

Schedule Recommendation

Schedules the index recommendation on a later date and time.

Schedule Recommendation on page 96

Tools Menu
Use the Tools menu to access different applications while working with Index Wizard and to set preferences. The following table describes the commands on the Tools menu.

12

Teradata Index Wizard User Guide

Chapter 2: Interface Windows Menu

Table 9: Tools Menu Commands and Descriptions

Menu Command Execute SQL

Sub Menu

Toolbar Button

Description Executes SQL statements using either Teradata SQL Assistant (separate application) or the Execute SQL - Query dialog box. Defines a data source if ODBC type of connectivity is used.

For More Information Executing SQL Feature on page 101

Define Data Source Teradata System Emulation Tool Teradata Visual Explain Teradata Statistics Wizard Options > Preferences Index Analysis Inputs...

Defining a Data Source on page 18

Opens Teradata System Emulation Working With Other Teradata Client Tool. Tools on page 103 Opens Teradata Visual Explain. Working With Other Teradata Client Tools on page 103 Working With Other Teradata Client Tools on page 103 Preferences on page 103 Index Analysis Inputs on page 104

Opens Teradata Statistics Wizard.

Set preferences with Index Wizard. Allows you to set certain index analysis inputs.

Windows Menu
Use the Windows menu when reports are generated to help manage the reports. The following table describes the commands on the Windows menu.
Table 10: Windows Menu Commands and Descriptions

Menu Command Close

Toolbar Button

Description Closes the active report window.

Close All

Closes all report windows.

Cascade Windows

Cascades all the open report windows.

Teradata Index Wizard User Guide

13

Chapter 2: Interface Help Menu


Table 10: Windows Menu Commands and Descriptions (continued)

Menu Command Tile Horizontally

Toolbar Button

Description Tiles all the open report windows horizontally.

Tile Vertically

Tiles all open report windows vertically.

Help Menu
Use the Help menu to access the Help system, as well as version and copyright information. The following table describes the commands on the Help menu.
Table 11: Help Menu Commands and Descriptions

Menu Command Help Contents

Toolbar Button

Description Opens the Help system.

About Teradata Index Wizard...

See Version and Copyright Information on page 14.

Version and Copyright Information


Open the About Teradata Index Wizard dialog box to see the version and copyright information for the software you are using.

To open the About dialog box


From the Help menu, choose About Teradata Index Wizard.
Table 12: About Dialog Box

Field Version Date Created System

Description Version number of the software installed. Date the installed version of software was created. System name the user was last connected to. The connectivity type is indicated as a suffix to the system name. For example, -ODBC or -CLI. This field is blank if you are not connected to a Teradata Database.

14

Teradata Index Wizard User Guide

Chapter 2: Interface Status Bar


Table 12: About Dialog Box (continued)

Field Connection

Description If you are connected to a Teradata Database, this field always shows Logged on. This field is not shown if you are not connected to a Teradata Database.

User

User name that is connected to the Teradata Database. This field is not shown if you are not connected to a Teradata Database.

Copyright dates and legal notices are also provided.

Status Bar
The status bar, shown in the following figure, has three panes and a status message.
Figure 3: Status Bar

The first pane displays the operations that can be performed at a particular time in the process. This helps the user by indicating the next possible step in the recommendation process. The second pane displays the current QCD name and the current cached workload name if one has been defined or selected. The third pane displays the current logon information. The status message displays the current state of Index Wizard.

Shortcut Menus
Use the shortcut menus to manage the spreadsheets that appear in various dialog boxes.

Teradata Index Wizard User Guide

15

Chapter 2: Interface Shortcut Menus

The following figure shows an example of a shortcut menu.


Figure 4: Example of a Shortcut Menu

Functions include the following: Copy - selected data to the Clipboard. Find - items on a spreadsheet. Hide/Show - specific or all columns in a spreadsheet. Select All - rows in a spreadsheet. Clear All - de-select all rows in a spreadsheet. Save As - tables as text files (.txt) or Excel files (.xls). Print - spreadsheets.

To access a shortcut menu


1 2

Place the cursor on the first row of the spreadsheet appearing in a dialog box. Right-click and choose an option from the shortcut menu.

16

Teradata Index Wizard User Guide

CHAPTER 3

Using Index Wizard-Quick Start

The quick start is intended for experienced Teradata Database users who may be new to Index Wizard. The quick start runs through the steps to define, analyze, and validate a workload and create index recommendations. The steps are shown in order below, but can be performed in any order. Launching Teradata Index Wizard Selecting a Logon Method Defining a Workload Running an Index Analysis Selecting Reports Validating Recommendations Executing Recommendations

Launching Teradata Index Wizard


To start Index Wizard
Select Start > Programs > Teradata Index Wizard.

The Index Wizard main window opens.


Figure 5: Index Wizard Main Window

Go to the next step, Selecting a Logon Method on page 18.

Teradata Index Wizard User Guide

17

Chapter 3: Using Index Wizard-Quick Start Selecting a Logon Method

Selecting a Logon Method


To use Index Wizard, you need to log on to the Teradata Database. Before logging on, select a logon method. You can connect using either ODBC or WinCLI.

To select a logon method


1 2 3 4

Go to Tools > Options > Preferences. The Preferences dialog box opens and the Connectivity tab is active. Choose the connectivity type, either ODBC or WinCLI. Click Apply, and click OK. Each logon method uses a slightly different procedure: If you are logging on with ODBC, follow the procedure, Connecting Through ODBC on page 18. If you are logging on with WinCLI, follow the procedure, Connecting Through WinCLI on page 19.

Connecting Through ODBC


Teradata Index Wizard allows you to connect to a database via ODBC.

To connect using ODBC


The ODBC connection procedure assumes you have already created a data source. If you have not defined a data source, do so before connecting. See Defining a Data Source on page 18.
1 2

Select File > Connect or click Select a data source, and click OK.

The Please Select a Data Source dialog box opens. The Teradata Database Connect dialog box opens. To fill in the fields, refer to ODBC Driver for Teradata User Guide. See Additional Information on page v. You are now logged on to the selected database. If errors occur, see Connection Errors on page 20.
3

Go to the next step, Defining a Workload on page 20.

Defining a Data Source Use the ODBC Data Source Administrator to create ODBC data sources. You can also use the ODBC Data Source Administrator to configure some features of the drivers installed on your system.

18

Teradata Index Wizard User Guide

Chapter 3: Using Index Wizard-Quick Start Selecting a Logon Method

To define a data source


1

Open the Microsoft ODBC Data Source Administrator using one of these options: From the Teradata Index Wizard main window, select Tools > Define Data Source. Or, from your Windows desktop, select Start > Programs > ODBC > 32-bit ODBC Administrator. The ODBC Data Source Administrator dialog box opens.

Open the Create New Data Source dialog box using one of these options: From the System DSN tab, click Add. Or, from the User DSN tab, click Add.

3 4

From the Drivers list, select Teradata. Click Finish. The ODBC Driver Setup for Teradata Database dialog box opens. This dialog box is specific to your Teradata Database.

Fill out the information in this dialog box. Refer to ODBC Driver for Teradata User Guide. See Additional Information on page v.

Connecting Through WinCLI


Teradata Index Wizard allows you to connect to a database via WinCLI.

To connect using WinCLI


1 2

Select File > Connect. The Connect to Teradata Database dialog box opens. Use the following table to fill in the dialog box.
Table 13: Connect Through WinCLI Dialog Box Description

Dialog Options Database Name

Description Select the Teradata Database from the drop-down list or type a valid Teradata Database name. The IP address of the server should be stored in the hosts file to use a Host name. Select from the list of mechanisms that automatically appear in this box. Each Teradata site implements their own security measures. If a list of mechanisms do not appear and you cannot log on to the Teradata Database, consult your DBA or the person responsible for the security of your Teradata Database. The authentication parameter is a password required by the selected mechanism. As you type, asterisks appear to conceal the password. If you do not know the password, consult your DBA.

Authentication Mechanism

Authentication Parameter

Teradata Index Wizard User Guide

19

Chapter 3: Using Index Wizard-Quick Start Defining a Workload


Table 13: Connect Through WinCLI Dialog Box Description (continued)

Dialog Options User Name Password Session Character Set Default Database Account String 3

Description Select the user name from the drop-down list or type in a valid user name. The user name should already be defined for the server. Enter the password for the user name defined in the User Name field. [Optional] Select the session character set from the list. Choose one of the following: ASCII, KANJISJIS_0S, UTF16, or UTF8. [Optional] Select the default database for the session. [Optional] Specify the logon account string.

After you have filled in the fields, click OK. You are now logged on to the selected database. If any errors occur, see Connection Errors on page 20.

Go to the next step, Defining a Workload on page 20.

Connection Errors
If the logon information provided is not correct, an error message appears. The following table explains the possible problem of each type of connection error. For more information about error messages, see Appendix B: Index Wizard Error Messages.
Table 14: Connection Errors Dialog Box Description

Error Type Name error User Name error

Description If the Teradata Database name specified is not present in the Hosts file, Name error appears. If there is a user name error or if the user does not exist in the Teradata Database name, a User Name error appears. For more information, see Defining a Data Source on page 18. If the password for the user is not valid or is incorrect, the Password error appears. For more information, see Defining a Data Source on page 18.

Password error

Defining a Workload
The starting point for the index recommendation process is capturing a representative sample of active SQL statements. This is done by defining a a set of queries as a workload. Typically, a workload is comprised of a set of queries from a production system.

20

Teradata Index Wizard User Guide

Chapter 3: Using Index Wizard-Quick Start Defining a Workload

Index Wizard provides the following ways to define a workload: Selecting queries from the DBQL. Keying in the SQL statement manually. The SQL statements can also be selected from one or more files. Using an existing set of execution plans from the user defined QCD. Importing SQL statements from a file. Creating a new workload from an existing one.

To define a workload
1

Select Workload > Create and choose a workload definition method. The types of definitions are shown below. For specific procedures about each workload definition method, click on the following types: Using DBQL Statements Using SQL Statement Text Selecting SQL Statements from the QCD Importing a Workload Creating a New Workload from an Existing Workload Updating an Existing Workload

Fill in the dialog box as needed. After the workload is created, it is stored, and a summary window opens showing the workload.

Click OK to complete the workload definition step. After a workload is created, it stays in the workload cache and is used by default in the analysis, reports, and validations steps. The following reports are available after the workload is defined: Existing Indexes Report Update Frequency Report Table Usage Analysis Report Workload Analysis Report Table Scan Report

Go to the next step, Running an Index Analysis on page 22

For more information on workloads, see Chapter 4: Defining a Workload.

Teradata Index Wizard User Guide

21

Chapter 3: Using Index Wizard-Quick Start Running an Index Analysis

Running an Index Analysis


After the workload is defined, the next step is to analyze the queries in the workload and recommend secondary indexes that enhance performance.

To start a new index analysis


1

Select Analysis > New Analysis. The Index Analysis dialog box opens.

2 3

The QCD should already be loaded. If it is not, click

to search.

The cached workload should already be loaded into the Workload field. If it is not, click .

Ensure all the tables are highlighted in the Select Tables section. Data Demographics are available for tables shown in the Select Table section. For more information, see Chapter 10: Data Demographics.

5 6 7

In the Recommendation Identification field, enter a unique recommendation tag. Click Advanced to set additional recommendation parameters. For more information, see Advanced Button on page 66. Click OK to begin the analysis. The index analysis engine runs inside the Teradata parsing engine to enumerate possible secondary index candidate combinations. The engine then evaluates them against the workload by simulating the index set and using the Teradata Optimizer to cost the queries using the simulated indexes. After the Teradata Database returns with the analysis results, the Index Analysis Summary window opens showing the analysis summary. The analysis also creates a series of reports showing the results of the analysis. For more details on analysis, see Chapter 5: Index Analysis.

Go to the next step, Selecting Reports on page 23.

22

Teradata Index Wizard User Guide

Chapter 3: Using Index Wizard-Quick Start Selecting Reports

Selecting Reports
When a workload is created or an index analysis completed, a series of reports are generated. This section gives a brief overview of each report. For more about reports, see Chapter 6: Viewing Reports.

To select a report
1 2

Select Reports > Current Workload. Select the report you want to view. The buttons at the left of the main Index Wizard window (default position) can also be used to bring up individual reports. The following table briefly describes each report and shows its associated button.

Table 15: Report Buttons and Description

Toolbar Button

Report Name and Description Index Recommendations Report Displays information about the recommended set of indexes for the tables in the workload. Existing Indexes Report Displays information on the existing set of indexes for the tables in the workload. Query Cost Analysis Report Displays the execution cost improvement for the SQL statements with the recommended set of indexes. Update Frequency Report Displays the relative number of updates on a given table in the workload when compared to the number of accesses from the table. Index Maintenance Cost Report Displays the estimated cost of maintaining recommended indexes for a particular recommendation ID on a workload. Table Usage Analysis Report Displays the usage of tables within the workload. Table Scan Report This report contains information about the usage of tables in the workload. It aids the user in selecting tables over which the set of indexes will be recommended. Table cardinality (estimates), access types, and geographies can give clues as to where an index might be of value.

For More Information Index Recommendation Report on page 83

Existing Indexes Report on page 78

Query Cost Analysis Report on page 83

Update Frequency Report on page 79

Index Maintenance Cost Report on page 86

Table Usage Analysis Report on page 79 Table Scan Report on page 80

Teradata Index Wizard User Guide

23

Chapter 3: Using Index Wizard-Quick Start Validating Recommendations


Table 15: Report Buttons and Description (continued)

Toolbar Button

Report Name and Description Object Global Use Count Report Shows the objects that are accessed the most on a table. Workload Analysis Report This report provides a statement-wise analysis of the workload. Summary Report This report shows details about the secondary index count and recommendation count made in a specific analysis for all tables in a workload.

For More Information Object Global Use Count Report on page 82 Workload Analysis Report on page 81 Summary Report on page 85

Go to the next step, Validating Recommendations on page 24.

Validating Recommendations
The validation step is a way to check the impact of applying index recommendations on the production. The validation step does not actually apply the index to the production system.

To validate an index recommendation


1

Select Validation > Load Recommendations from QCD The Recommendations from QCD dialog box opens prompting for an index recommendation to validate. Index Wizard defaults to the last workload/recommendation in the cache.

2 3 4

Make sure Workload and Index Tag are correct. Leave Validate on Another System unchecked. Select Next. A dialog box appears containing recommendation information. Specify which individual recommendations to validate by selecting or deselecting them. Click View DDL Statements to view the DDL for implementing the recommendation. There is an option for setting the data sampling for collecting sample statistics. Click Data Sampling to open this dialog box.

Select Validate to begin the validation. The system validates the index recommendation by simulating the indexes and generating query plans for each query in the workload. The plans are stored in the QCD and compared to the plans saved without the recommendations. When the validation is complete, a Validation Results Report displays.

24

Teradata Index Wizard User Guide

Chapter 3: Using Index Wizard-Quick Start Executing Recommendations

After viewing the Validation Results Report, go to the next step, Executing Recommendations on page 25.

Validation Results Report


The Validation Results Report displays information on the validation analysis of the recommended index. Additionally, the summary contains the QCD name and System name where the validation was completed and an overall percentage improvement in cost for the entire workload.

To view data using Visual Explain


Click Compare.

The Teradata Visual Explain application opens showing a graphic comparison between the plan with the index recommendations and the plan with the existing indexes. For more information on validation, see Chapter 7: Validating an Index Recommendation. Go to the next step, Executing Recommendations on page 25.

Executing Recommendations
The final step in the quick start is implementing a recommended index (referred to as execution). Index Wizard provides two ways to implement the recommendations. You can implement the recommended indexes immediately or schedule the indexes to be created in the future.

To execute recommendations immediately


1 2

Select Creation > Execute Immediately. The Execute Recommendations dialog box opens. Select which recommendations from this list that you want to execute (the default is all recommendations).

To schedule recommendations at a later time


1 2 3

Select Creation > Schedule Recommendations. The Schedule Recommendations dialog box opens. Select your recommendations from the list that you want to schedule. Select the time, fill in the remaining information, and click Schedule.

For more information, see Chapter 8: Executing Recommendations.

Teradata Index Wizard User Guide

25

Chapter 3: Using Index Wizard-Quick Start Executing Recommendations

26

Teradata Index Wizard User Guide

CHAPTER 4

Defining a Workload

A workload is a set of SQL statements executed against a database. A single SQL statement is also a valid workload. Index Wizard analyzes these defined workloads and makes index recommendations. A workload can be defined in the following ways: Using DBQL Statements Using SQL Statement Text Selecting SQL Statements from the QCD Importing a Workload Creating a New Workload from an Existing Workload Updating an Existing Workload

Using DBQL Statements


A database query log (DBQL) is a historical record of SQL statements that are run on the Teradata Database over a period of time. In system tables, the DBQL stores performancerelated data for a request such as the account ID, the query, the usage of secondary indexes, rows returned, and start and end time. You query these tables to select SQL statements that can be analyzed for performance improvement. Index Wizard allows you to query these tables based on criteria you supply. The queries selected are defined as a workload. You can define a workload using DBQL statements. After the workload is defined, the execution plans are captured in the specified QCD. Note: If the database is restarted for any reason, statements from the DBQL tables may not be picked up correctly. To avoid duplicate IDs for different statements, clear the information from the DBQL tables or move the information to a different database periodically. Also, use the filters when creating the workload as described in Table 16 on page 28.

To define a workload using DBQL statements


You can set the sample size for collecting statistics on the tables prior to creating a workload. The statistics are collected into the QCD while capturing the execution plans for the workload statements. Go to Tools > Options > Preferences, and select the General tab.
1

Select Workload > Create > From DBQL Statements.

Teradata Index Wizard User Guide

27

Chapter 4: Defining a Workload Using DBQL Statements

The Define Workload from DBQL Statements dialog box opens.


Figure 6: Define Workload from DBQL Statements Dialog Box

[Optional] In the DBQL Search Criteria section, set the search criteria (also referred to as filters) for defining a workload by entering a start or end date and the start or end time as well as the result rows and step count. The following table describes the fields in this section of the dialog box.
Table 16: Define Workload from DBQL Statements Dialog Box: DBQL Search Criteria Description

Field

Description

DBQL Search Criteria Start Date Enter a start date for Index Wizard to use in searching for queries that were submitted on or after the specified start date. When entering the date, use the following format: YYYY-MM-DD. If the start time is not specified, all statements from the DBQL are loaded.

28

Teradata Index Wizard User Guide

Chapter 4: Defining a Workload Using DBQL Statements


Table 16: Define Workload from DBQL Statements Dialog Box: DBQL Search Criteria Description (continued)

Field Start Time

Description Enter a start time for Index Wizard to use in searching for queries that were submitted on or after the specified start time. When entering the time, use the following format: HH:MM:SS. If the start time is not specified, the default start time is used (00:00:00).

End Date

Enter an end date for Index Wizard to use in searching for queries that were submitted on or before the specified end date. When entering the date, use the following format: YYYY-MM-DD. If a start date is specified, but no end date is specified, all statements from the DBQL are loaded from the start date forward.

End Time

Enter an end time for Index Wizard to use in searching for queries that were submitted on or before the specified end time. When entering the time, use the following format: HH:MM:SS. If the end time is not specified, the default end time is used (23:59:59).

Result Rows

Specifies the minimum number of rows returned for the queries retrieved from the DBQL. Note: This field is unavailable if you are connected to V2R5 systems.

Step Count

Specifies the minimum number of steps for the queries retrieved from the DBQL.

3 4

In the Statement Text box, type a portion of or the entire SQL statement you want retrieved from the DBQL. Click View SQL... The Statement Text dialog box opens enabling you to view the SQL statements that will be executed against the DBQL tables. To append additional or custom search criteria to the end of queries, enter the text in both of the text boxes and click OK.

Teradata Index Wizard User Guide

29

Chapter 4: Defining a Workload Using DBQL Statements Figure 7: Statement Text Dialog Box

To create the workload from queries submitted by a set of users or a set of accounts, click Advanced... The Select Users and Accounts dialog box opens enabling you to define additional search criteria.
Figure 8: Select Users and Accounts Dialog Box

30

Teradata Index Wizard User Guide

Chapter 4: Defining a Workload Using DBQL Statements 6

Select a user name and account string for the DBQL search criteria. After you select the user names and/or account strings, they are retrieved from the DBQL and appended to the statement. The following table describes the fields and buttons in this dialog box.
Table 17: Select Users and Accounts Dialog Box Description

Field/Button Select User List Users

Description Type the name(s) of the user(s) for which the SQL statements is retrieved from the DBQL. Displays a list of users in the system into the top left pane. If no user is selected, none of the users are taken by default.

Add >> <<Remove Select Account List Accounts

Adds the typed or highlighted user or account to the selected list. Removes the highlighted user or account from the selected list. Type the account name(s) for which the SQL statements are retrieved from the DBQL. Displays a list of account strings in the system into the bottom left pane. If no account is selected, none of the accounts are taken by default.

Click Browse DBQL to load the DBQL statements into the grid. Note: Depending on the size of the DBQL and the search criteria you entered, loading of the DBQL data may take extra time. You can click Abort any time during this process.

8 9

In the QCD Name box, type or click workload is to be created.

to browse for the QCD in which the captured

In the Workload Name box, type the name of the workload to be created.

10 The following table describes the columns in the grid.


Table 18: Define Workload from DBQL Statements Dialog Box: DBQL Statements

Field/Button Frequency Default Database

Description Indicates the number of times the statement is logged in the DBQL and meets the search criteria specified. This field can be edited. The default database from which the query was executed. Note: If the new default database is different than the logon default database, Index Wizard maintains the logon default database when it executes the DATABASE statement. The logon default database is restored after the workload creation is completed.

Statement Text

Displays the text of the SQL statement retrieved from the DBQL.

Teradata Index Wizard User Guide

31

Chapter 4: Defining a Workload Using SQL Statement Text 11 [Optional] To remove statements in the grid, click the row number to highlight the

statement you want to remove and click Remove. To remove multiple rows simultaneously, hold the Shift key as you click the row numbers, and then click Remove.

12 Click OK to start the workload definition process.

When the process is complete, the Workload Definition Summary window opens.
Figure 9: Workload Definition Summary Window

If errors occur, see Errors While Defining a Workload on page 36.


13 Check the workload, and click OK.

The workload is now in the workload cache and is ready to be analyzed. For more information, see Chapter 5 Index Analysis on page 53

Using SQL Statement Text


SQL statements can be typed in or selected from one or more files. All text specified up to a semi-colon followed by a new line without any additional text is considered a single request. After the workload is defined, the execution plans are captured in the specified QCD.

32

Teradata Index Wizard User Guide

Chapter 4: Defining a Workload Using SQL Statement Text

To define a workload using an SQL statement


You can set the sample size for collecting statistics on the tables prior to creating a workload. The statistics are collected into the QCD while capturing the execution plans for the workload statements. Go to Tools > Options > Preferences, and select the General tab.
1

Select Workload > Create > Using Statement Text. The Define Workload using Statements dialog box opens.
Figure 10: Define a Workload using Statements Dialog Box

Set the criteria for defining the workload by filling in the dialog box.

Teradata Index Wizard User Guide

33

Chapter 4: Defining a Workload Selecting SQL Statements from the QCD

The following table describes the fields and buttons in this dialog box.
Table 19: Define Workload Using Statements Dialog Box Description

Field/Button SQL Statements SQL Statement Frequency Add Browse

Description

Type the SQL statement to be analyzed or select a file by clicking Browse. Specifies the number of times the statement gets executed in the workload. The default value is 1. Adds the SQL statement written in the SQL Statement box to the workload. Browses the file which contains the SQL statements.

Selected Statements QCD Name Specifies the QCD on which the captured workload is created. Click search existing QCDs. to

Workload Name Creates a name for the workload to be created. Frequency Statement Text Remove Replace 3 Displays the frequency of each SQL statement that has been added. Displays the text of the SQL statement. Removes the selected SQL statements. Replaces the selected statement with the statement in the edit box.

Click OK to start the workload definition process. When the process is complete, the Workload Definition Summary window opens. If errors occur while creating a workload, see Errors While Defining a Workload on page 36.

Check the workload, and click OK.

The workload is now in the workload cache and is ready to be analyzed. For more information, see Chapter 5 Index Analysis on page 53

Selecting SQL Statements from the QCD


SQL statements can be selected from the query capture database (QCD). Use this option if the execution plans are already available in the QCD. The Query ID and the Query Tag fields are optional. If no values are entered in these fields, all the statements in the QCD are displayed when you click the Browse button. Query IDs can be added as individual queries separated by comma(s). For example: 1, 2, 3. Use hyphens to separate queries in a range. For example: 5-10. Commas and hyphens can be used together. For example: 1, 2, 3, 5-10.

34

Teradata Index Wizard User Guide

Chapter 4: Defining a Workload Selecting SQL Statements from the QCD

The Query Tag field is used to retrieve statements from the QCD. The field also accepts wild card characters. Using a percentage sign (%) in this field, loads all the queries from the database specified.

To define a workload from the QCD


1

Select Workload > Create > From QCD Statements. The Define Workload from QCD Statements dialog box opens.
Figure 11: Define a Workload from QCD Statements Dialog Box

Fill in the dialog box to set the criteria for defining the workload. The following table describes the fields and buttons in this dialog box.
Table 20: Define Workload from QCD Statements Dialog Box Description

Field/Button QCD Name Query ID Query Tag

Description Enter the QCD name to be browsed for SQL statements or click Enter the Query ID of the statements. Enter the Query Tag of the statements. .

Teradata Index Wizard User Guide

35

Chapter 4: Defining a Workload Errors While Defining a Workload


Table 20: Define Workload from QCD Statements Dialog Box Description (continued)

Field/Button Browse QCD Workload Name Select All Deselect All 3 4

Description Searches the QCD for statements based on the Query ID, or Query Tag values entered. Creates a workload with the workloadname description for the selected statements in the grid. Selects all the statements in the list. Deselects all the statements from the list.

Click OK to start the workload definition process. When the process is complete, the Workload Definition Summary window opens. Check the workload, and click OK.

The workload is now in the workload cache and is ready to be analyzed. For more information, see Chapter 5 Index Analysis on page 53

Errors While Defining a Workload


During the creation of a workload, executions plans for selected statements are captured in the specified QCD. If an error occurs as Index Wizard tries to define a workload, a Warning dialog box displays so you can tell Index Wizard how to proceed.
Figure 12: Warning Dialog Box

36

Teradata Index Wizard User Guide

Chapter 4: Defining a Workload Importing a Workload

The following table describes the options in the Warning dialog box.
Table 21: Warning Dialog Box Description

Option Continue creating workload with remaining statements? Cancel workload and delete plans saved thus far? Cancel workload and retain the inserted plans? Retry last statement Ignore all subsequent errors

Description Ignores the error and continues with the workload creation. Halts the workload creation process. Plans already inserted as a part of the workload are deleted. Halts the workload creation process. Plans already inserted as a part of the workload are retained in the QCD. Resubmits the last statement. Suppresses any further non-critical errors during workload creation. Critical errors will still appear even if you have selected this check box. Note: This option is available when the Continue creating workload with remaining statements? button has been selected.

Importing a Workload
SQL statements can be imported from another system onto a test system. When the file containing the imported workload information (.mcf file) is opened, the environment of the production system is imported onto the test system.

To import a workload
1 2

Select Workload > Create > Import Workload The Select a File to Import Workload dialog box opens. Choose the workload file to import, and click Open.

Teradata Index Wizard User Guide

37

Chapter 4: Defining a Workload Importing a Workload

The Import File dialog box opens with the workload you selected.
Figure 13: Import File Dialog Box

Fill in the dialog box to set the criteria for defining the workload. The following table describes the fields and buttons in this dialog box.
Table 22: Importing a Workload Dialog Box Description

Field/Button Import Into Parent Database Target QCD Name

Description

Selects the parent database that will be importing information into. Enter or use the Browse (...) button to select the QCD Name under which the imported workload is stored.

38

Teradata Index Wizard User Guide

Chapter 4: Defining a Workload Importing a Workload


Table 22: Importing a Workload Dialog Box Description (continued)

Field/Button Select QCD Name Workload Name Import Options Check Boxes> Object definitions Statistics Random AMP Sample Demographics Execution Plan Workloads QCD Data Cost Parameters Cost Profiles Import Set TLE Error Handling

Description

Select the QCD name from the imported workload. Select the name of workload to be imported.

Use these check boxes to set import options for the workload you are importing. See Import Options on page 43 for a detailed explanation of these options.

Starts the import operation. Opens the Set Target Emulation dialog box. For more information, see Setting the TLE on page 39. Opens the Error Handling dialog box, which has several options for handling errors that may occur when importing a workload. For more information, see Handling Errors on page 41.

4 5

Click Import to start the workload definition process. When the process is complete, the Workload Definition Summary window opens. Check the workload, and click OK.

The workload is now in the workload cache and is ready to be analyzed. For more information, see Chapter 5 Index Analysis on page 53

Setting the TLE


TLE is a database feature that enables you to emulate a production environment on a completely different and foreign environment. When TLE options are imported and enabled, the Optimizer generates plans relative to the emulated production environment rather than the local environment. This enables you to confidently perform and test administrative and performance enhancing modifications, such as indexing, without the risk of saturating or altering the production environment.

Teradata Index Wizard User Guide

39

Chapter 4: Defining a Workload Importing a Workload

To set the TLE


1

From the Import File dialog box, click Set TLE. The Set Target Level Emulation dialog box opens with the Set RAS tab active.
Figure 14: Set Target Level Emulation Dialog Box - Set RAS Tab

Fill in the dialog box. The following table describes the fields and buttons in this dialog box.
Table 23: Set Target Level Emulation Dialog Box Description

Field/Button Set RAS tab Select Table Names Session and System Select All Set Costs tab Select Cost Tag window

Description

Shows the workload tables selected. Selects the RAS level you want. This option allows the user to analyze the imported workload in the same session. Selects workload tables in the Select Table Name grid.

Shows the cost tags. This option allows the user to analyze the imported workload in the same session.

40

Teradata Index Wizard User Guide

Chapter 4: Defining a Workload Importing a Workload


Table 23: Set Target Level Emulation Dialog Box Description (continued)

Field/Button Session, IFP, System 3 4

Description Selects the cost level you want for the workload.

Click Apply. Click OK to return to the Import File dialog box.

Handling Errors
You can control the way errors are handled during the import process. You do this by setting error handling options before you import a workload.

To set error handling options


1 2

From the Import File dialog box, click Error Handling. The Error Handling dialog box opens.
Figure 15: Error Handling Dialog Box

Teradata Index Wizard User Guide

41

Chapter 4: Defining a Workload Importing a Workload 3

Fill in the dialog box. The following table describes the check boxes in this dialog box.
Table 24: Error Handling Dialog Box Description

Check Box/Field General Log only failures in Summary Report Ignore database errors

Description

Logs failed operations into the summary report. Consult the log file for the cause of any failures. Teradata Database error messages are ignored during import. If you clear this check box, all Teradata Database error messages are displayed.

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 access rights or permanent space errors. Database errors that can be retried include: 2644, 2843, 3250, 3523, or 3524. If you clear this check box, 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 nonexisting QCDs Displays a message to create a QCD if the target QCD doesn't exist. If you clear this check box, a target QCD is created automatically.

Display duplicate primary key error Random AMP 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 new tag for 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.

42

Teradata Index Wizard User Guide

Chapter 4: Defining a Workload Importing a Workload


Table 24: Error Handling Dialog Box Description (continued)

Check Box/Field Workloads

Description 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, DBSControl 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.

Click OK to return to the Import File dialog box.

Import Options
Import options affect how the workload is imported.

To set import options


1 2 3

From the Import File dialog box, locate the import options on the left side of the dialog box. Fill in the dialog box. The following table explains each import option. Continue filling in the other fields in the Import File dialog box.
Table 25: Import Option Descriptions

Import Option Object Definitions Statistics Random AMP Sample Demographics Execution Plan Workloads QCD Data Cost Parameters Cost Profiles

Description Imports the object definition. Imports the information statistics. Imports random AMP samples. Imports the data demographics captured on the tables. Imports the execution plan. Imports workload data. Imports QCD data. Imports the cost parameters. Imports active or inactive cost profiles.

Teradata Index Wizard User Guide

43

Chapter 4: Defining a Workload Creating a New Workload from an Existing Workload

Creating a New Workload from an Existing Workload


You can create a new workload using the information from an existing workload. You can add statements from existing workloads, existing QCD statements, or statement text.

To create a new workload from an existing workload


1

Select Workload > Create > From an Existing Workload. The Create from Existing Workload dialog box opens.
Figure 16: Create from Existing Workload Dialog Box

2 3

Select the workload using the QCD and workload fields. For more information, see Table 26 on page 45. Select the type of statement to add in the Add Statements area by selecting the appropriate option button, and click Browse. The Add Workload Statements dialog box opens. See Table 27 on page 46. Choose the statements to add, and click Add To List. The selected statements are added to the main list of statements. For more information, see Adding Additional Workload Statements on page 45.

In the New Workload Name box, type the name of the new workload.
Teradata Index Wizard User Guide

44

Chapter 4: Defining a Workload Creating a New Workload from an Existing Workload 6 7

Click Create. The Workload Summary window appears showing the new workload summary. Check to ensure the workload is correct, and click OK. The workload is now in the workload cache and is ready to be analyzed. For more information, see Chapter 5 Index Analysis on page 53 The following table explains the Create from Existing Workload dialog box.
Table 26: Create from Existing Workload Dialog Box Description

Window Option

Description

Workload Statements QCD Name Enter the QCD name to be browsed for SQL statements. to browse for workloads.

Workload Name Enter the workload or click Statement field Add Statements Add Statement options

Shows the Query ID, frequency, and statement text.

Use Add Statements to add additional statements to an existing workload. The Browse button opens a dialog box based on the additional workload statement source. Use the dialog box to select the additional statement. Types of statements include: QCD Statements Statement Text Other Workloads For information about these dialog boxes, see Adding Additional Workload Statements on page 45. Click to open a window based on the workload choice. Note: Only highlighted statements are included in the workload definition.

New Workload Name Create

Names the new workload. Creates the new workload with the selected statements.

Adding Additional Workload Statements


There are several ways to add statements to the new workload including: QCD Statements Statement Text Other Workloads

Teradata Index Wizard User Guide

45

Chapter 4: Defining a Workload Updating an Existing Workload

The following table explains each option.


Table 27: Add Workload Statements Dialog Box Description

Window Option QCD Statements Query ID Query tag

Description

Enter the Query ID or Query tag of the statement you want to add. Click to look for existing workloads in the QCD. Click Add to List to add the statements.

SQL Statements SQL Statements field Enter the SQL statements you want to add to the workload in the field Use the Browse button to add statements from a file. Use the Frequency box to indicate the frequency of statements with in workload. Click Add to add the workloads to the Selected Statements field. Click Add to List to add the statements. Other Workloads Workload Name Statements field Enter a workload name, or click Browse to get a list of existing workloads. Shows the statements to be added. Click Add to List to add the statements.

Updating an Existing Workload


You can update a workload that has already been created by using the Update Existing Workload option. You can add additional SQL statements or make other changes, then redefine the workload.

To update an existing workload


1

Select Workload > Update Existing Workload

46

Teradata Index Wizard User Guide

Chapter 4: Defining a Workload Updating an Existing Workload

The Update Existing Workload dialog box opens.


Figure 17: Update Existing Workload Dialog Box

Select the workload you want to update by selecting the QCD and workload in the dialog box. The following table explains the dialog box options.
Table 28: Update an Existing Workload Dialog Box Description

Field/Button

Description

Workload Statements QCD Name Enter the QCD name to be browsed for SQL statements. to browse for workloads.

Workload Name Enter the workload or click Statement field Add Statements

Shows the Query ID, frequency, and statement text.

Teradata Index Wizard User Guide

47

Chapter 4: Defining a Workload Updating an Existing Workload


Table 28: Update an Existing Workload Dialog Box Description (continued)

Field/Button Add Statement options

Description Use Add Statements field to add additional QCD statements to an existing workload. The Browse button opens a dialog box based on the additional workload statement source. Use the dialog box to select the additional statement. Types of statements include: QCD Statements Statement Text Other Workloads For more information about these dialog boxes, see Add Statements Options on page 48. The Browse button opens a window based on the workload choice Note: Only highlighted statements are included in the workload definition.

Update 3

Updates the workload with the selected statements from the list.

Select the type of update information you want, QCD Statement, Statement Text, Other Workloads, and click Browse. The Add QCD Statements dialog box opens allowing you to choose the statements to add to the existing workload.

4 5 6

Click Add to List. The selected statements are added to the existing workload. Close the Add QCD Statements dialog box. From the Update Existing Workload dialog box, and click Update. Index Wizard updates the workload with the new statements and opens the Workload Definition Summary window showing the new workload.

Click OK to close the window. The workload is now loaded into the workload cache and is ready to be analyzed. For more information, see Chapter 5 Index Analysis on page 53. You can also perform a what-if analysis (see What-if Analysis on page 61) or validate the index recommendation (see Chapter 7 Validating an Index Recommendation on page 89).

Add Statements Options


There are several ways to add statements to an existing workload including: QCD Statements Statement Text Other Workloads

48

Teradata Index Wizard User Guide

Chapter 4: Defining a Workload Additional Workload Functions

The following table explains each option.


Table 29: Add Statements Option Dialog Box Description

Field/Button QCD Statements Query ID Query tag

Description

Enter the Query ID or Query tag of the statement you want to add. Click to browse for existing workloads in the QCD. Click Add to List to add the statements.

SQL Statements SQL Statements field Enter the SQL statements you want to add to the workload in the field Use the Browse button to add statements from a file. Use the Frequency box to indicate the frequency of statements within a workload. Click Add to add the workloads to the Selected Statements field. Click Add to List to add the statements. Other Workloads Workload Name Statements field Enter a workload name, or click Browse to get a list of existing workloads Shows the statements to be added. Click Add to List to add the statements.

Additional Workload Functions


There are additional functions that allow you to manage workloads better. These functions include the following: Workload Cleanup on page 50 Viewing Workload Details on page 51 Workload Summary on page 52 Displaying Statement Text on page 52

Teradata Index Wizard User Guide

49

Chapter 4: Defining a Workload Additional Workload Functions

Workload Cleanup
Workload Cleanup allows you to delete workloads that you no longer need.

To cleanup a workload
1

Select Workload > Workload Cleanup.... The Workload Clean Up dialog box opens.
Figure 18: Workload Clean Up Dialog Box

2 3

Select the workload you want to delete by selecting the QCD and Workload. Select the Delete Plans box to delete the plans associated with a workload. Note: The associated query plans in the workload are deleted only if they are not used by another workload in the QCD.

Click Delete The workload is deleted.

50

Teradata Index Wizard User Guide

Chapter 4: Defining a Workload Additional Workload Functions

Viewing Workload Details


You can view the statements and operations on a particular workload.

To view workload details


1

Select View > Workload Details. The View Workload Details dialog box opens.

Enter a QCD and Workload name or click

The following table describes the fields and buttons in the dialog box.
Table 30: Workload Details Dialog Box Description

Field/Button Workload Statements Statement ID Frequency Statement text Workload Status Recommendation Id

Description

Displays the Query ID of the statement. Displays the frequency of the statement within the workload. Displays the text of the SQL statement. This section of the dialog box displays the status of the operations performed on the workload. Displays the recommendations ID, if analysis was performed on the workload. Each time an analysis is present, a new row is entered in the Workload Status table. Displays the index tag of the recommendations. For every recommendation, a new row for Index Tag is entered in the Workload Status table. Displays the name of the system on which the validation was last performed. Displays the time when the validation was last performed. Displays the QCD on which validation was last performed. Displays the system on which the recommendations were applied. This is the last system on which the recommendation was executed. Describes the last operation performed on the workload.

Index Tag

Validated System Validated Time Validated QCD Executed System Remarks 3

Click OK. The Workload Summary window opens showing the workload.

Teradata Index Wizard User Guide

51

Chapter 4: Defining a Workload Additional Workload Functions

Workload Summary
After the workload is created, the Workload Summary window opens. The window summarizes the workload just created. The window shows the workload name and ID as well as the number of statements and the begin and end time.

Displaying Statement Text


Index Wizard lets you view the statement text for workloads. You can also view statement text for the complete index/statistics DDL. See View Details Button on page 65.

To view statement text


1 2 3

Define a workload using any of the methods provided. You can also view an existing workload using the View menu. Right-click on the statement you want to view, and click View Statements. The View Statement dialog box opens showing the workload statements.

52

Teradata Index Wizard User Guide

CHAPTER 5

Index Analysis

After a workload is created, the next step is to analyze it for index recommendations that will improve database performance. Index Wizard may recommend that an index be added, dropped, or that no recommendation can be made. The methods of analyzing include: New Analysis - performs a new analysis on the current workload in the workload cache. Restart Analysis - continues a previously halted analysis. What-if Analysis - allows you to play with various analysis criteria to find the best set of indexes.

This section explains the following index analysis topics: Performing a New Analysis Restarting an Analysis What-if Analysis Index Analysis Summary View Reports

Performing a New Analysis


The New Analysis option starts a new analysis using the information from the current workload. The following steps explain how.

To start a new analysis


1

Select Analysis > New Analysis. The Index Analysis dialog box opens. See Figure 19 on page 54. Note: If you created a workload prior to this analysis, the workload information is already in place when the dialog box opens. Check to ensure the desired workload is loaded.

Use the Select All and Deselect All buttons to choose the tables from the list. By default, Index Wizard automatically selects all tables. Note: If you want to view the demographics of a table, right-click the Table Name column in the Select Table field, and click Data Demographics. This opens the Data Demographics applications. For more information, see Chapter 10: Data Demographics.

Teradata Index Wizard User Guide

53

Chapter 5: Index Analysis Performing a New Analysis 3 4 5 6

Name the recommendation using the Recommendation Tag field. To save the recommendation to a file, select the Save Recommendations to File box and enter or browse to a file. Click Advanced to set analysis criteria for the workload. See Advanced Index Parameters on page 55 for details about analysis criteria. Click OK to start the analysis. To abort the analysis, use the Abort button on the Analysis in Progress window. When the analysis is complete, the Index Analysis Summary window opens. This window shows the results of the analysis. For more information, see Index Analysis Summary Window on page 60.
Figure 19: Index Analysis Dialog Box

The following table describes the Index Analysis dialog box.

54

Teradata Index Wizard User Guide

Chapter 5: Index Analysis Performing a New Analysis

Table 31: Index Analysis Dialog Box Description

Field/Button QCD Name

Description If you created a workload prior to performing this analysis, the QCD is already in this field. If no QCD name appears, click drop-down menu. to view the available QCDs from the

Workload Name

If you created a workload prior to performing this analysis, the workload is already in this field. If no workload name appears, click from the drop-down menu. to view the available workloads

Workload Statements Spreadsheet Select Tables field

This shows the queries used in the current workload. Specifically the spreadsheet shows the Query ID, Frequency, and Statement Text. Shows a spreadsheet of the tables selected to be analyzed. The columns include Database Name, Table Name, Statement Access, Row Estimate, and Existing Indexes. Use these buttons to select or deselect all the statements in the Select Tables section. To select a single table, click the table in the spreadsheet. Use this option to give the index recommendation a tag. Use this option to save the recommendations to a file.

Select All\Deselect All Recommendation Tag Save Recommendations in Files Advanced

Allows you to set various parameters for the analysis. See Advanced Index Parameters on page 55 for more information.

Advanced Index Parameters


You can set various parameters that determine index recommendations.

To set advanced index parameters


1

From the Index Analysis dialog box, click Advanced. The Index Analysis Parameters dialog box displays. Note: You can also open this dialog box from Tools > Options > Index Analysis Inputs. For more information, see Index Analysis Inputs on page 104.

Teradata Index Wizard User Guide

55

Chapter 5: Index Analysis Performing a New Analysis 2

Fill in the dialog box. See Table 32 on page 56. Note: The following fields and buttons are enabled with Teradata Database V2R6.1 or later: Maximum Columns Per Join Index, Index Maintenance Mode, and Index Types.
Figure 20: Index Analysis Parameters Dialog Box

Table 32: Index Analysis Parameters Dialog Box Description

Field/Button Input Options Keep Existing Indexes Maximum Candidate Indexes

Description

Retains the existing indexes on the tables selected for analysis. To drop the indexes that may not be necessary, select No. The maximum number of candidate indexes per table to be searched when recommending an index. The default is 256. The valid range is 128 to 512.

56

Teradata Index Wizard User Guide

Chapter 5: Index Analysis Performing a New Analysis


Table 32: Index Analysis Parameters Dialog Box Description (continued)

Field/Button Maximum Indexes Per Table

Description The maximum number of new indexes, including secondary and join indexes, that can be recommended per table. This option can be used to restrict the number of index recommendations on a given table. The default is 16. The valid range is 1 to 32.

Maximum Columns Per The maximum number of composite secondary index columns to be Secondary Index considered in the index as specified by the INITIATE INDEX ANALYSIS statement used to start this analysis. The default is 4. The valid range is 1 to 64. Maximum Columns Per The maximum number of referenced columns in a single-table join Join Index index to be considered for index analysis. The default is 6. The valid range is 1 to 16. Note: Although the Teradata Database supports single column join indexes with as many columns that can fit within the system row size limit, Index Wizard is limited to recommendations involving no more than 16. Change Rate Threshold Specifies if columns are used for an index analysis. Columns with a change rating greater than specified are not considered during index analysis for potential indexes. Every column appearing in an UPDATE SET clause is automatically assigned a change rating ranging from 0 to 9, representing how frequently it is updated. The columns that are frequently updated, are assigned a very high update frequency of 9, while columns that are never updated are assigned a change rating of 0. For example, if the value is specified as 5, all columns having a change rating of 5 or less are considered for an index. This value is common for all columns to be considered for index analysis. The default is 5. The valid range is 0 to 9. Index Maintenance Mode Controls how estimated index maintenance costs are used during analysis. Choose from the following: Off: Maintenance costs are not estimated (feature is turned off). Report Only: Maintenance costs are estimated only as supplemental information for the final index recommendations. Evaluate: Maintenance costs are used to evaluate and choose between candidate indexes and are also included along with the final recommendations. The default is Report Only.

Teradata Index Wizard User Guide

57

Chapter 5: Index Analysis Performing a New Analysis


Table 32: Index Analysis Parameters Dialog Box Description (continued)

Field/Button Checkpoint Frequency

Description Specifies the number of queries after which a checkpoint snapshot is inserted. It must be a positive integer value. To have the CHECKPOINT clause ignored, type 0. To have no checkpoint information saved during an index analysis, leave this field blank. To have no checkpoint snapshot taken, the value in this field must be greater than the total number of queries to be analyzed. If the index analysis is halted for any reason, such as a Teradata Database restart or an Index Wizard restart, then perform a new analysis. Specifying the checkpoint frequency allows you to perform a restart at a later time on the halted analysis.

Use Modified Statistics

Specifies that modified statistics should be considered during the index analysis, if they are available. Modified statistics are read from the TableStatistics table of the QCD from the ModifyStats column rather than the statistics gathered with COLLECT STATISTICS (QCD Form). If the ModifiedStats column is not populated, then the statistics stored in StatisticsInfo are used instead and the result is the same as if you had not specified this option. If the modified statistics of a given column are older than the statistics recorded for the same column as part of another plan capture, then the latest among them is used.

Index Types Consider All Index Types With Index Types With No Index Types

Specifies the types of secondary and single-table join indexes that are to be considered for analysis. Select to consider all index types during index analysis. Select to consider only certain index types during index analysis, and then click Select Index Types. Select to avoid certain index types during index analysis, and then click Select Index Types.

58

Teradata Index Wizard User Guide

Chapter 5: Index Analysis Performing a New Analysis


Table 32: Index Analysis Parameters Dialog Box Description (continued)

Field/Button Select Index Types

Description Select to choose the index types to be used. The Index Types dialog box opens. Note: Only single-table join indexes are included in the analysis for choices 5 and 6. Hash indexes are not supported. Figure 21: Index Types Dialog Box

Set Defaults

Restores the default values for the fields in the dialog box.

Teradata Index Wizard User Guide

59

Chapter 5: Index Analysis Restarting an Analysis

Index Analysis Summary Window


When the analysis is complete, Index Wizard displays the results in the Index Analysis Summary window. For a description of the fields in this dialog box, see Table 41 on page 74. All the analysis reports are now available.
Figure 22: Index Analysis Summary Window

Restarting an Analysis
Restart Analysis is used to restart an analysis that was aborted because of various reasons including a database restart or a user abort. To restart the index analysis, the checkpoint frequency and the index tag must have been indicated when the original analysis was started. Note: Restarting a halted index analysis is permitted only by the same Teradata Database user who performed the original index analysis.

To restart an analysis
1

Select Analysis > Restart Analysis. The Restart Analysis dialog box opens.

2 3

Fill in the QCD Name, Workload Name, and Tag or click workload. Select the Recommendation Tag to restart.

to select the QCD and

60

Teradata Index Wizard User Guide

Chapter 5: Index Analysis What-if Analysis 4 5

To save the recommendation, select the Save Recommendations in Files and fill in or browse to a folder. Click OK. The analysis restarts.

What-if Analysis
A what-if analysis allows you to suggest indexes for the selected workload and monitor the performance improvement. Statistics in the simulation mode are collected into the QCD and are simulated to the Optimizer during the plan generation. Only the CREATE INDEX and COLLECT STATS are valid in this mode. If DROP INDEX is specified in the simulation mode, the indexes/stats are not provided to the Optimizer and the generated plans do not consider these indexes/statistics. You can build the required CREATE INDEX and COLLECT STATS DDL statements using Index Wizard. The DDL statements specified are submitted in a simulation mode to the Teradata Database and then the workload statements are submitted to generate the new execution plans.

To do a what-if analysis
1

Select Analysis > What-If Analysis The Select Workload dialog box opens.
Figure 23: Select Workload Dialog Box

Enter a QCD Name where Index Wizard will look for SQL statements. You can click load a list of available QCDs, then select the name of the QCD from the list.

to

Teradata Index Wizard User Guide

61

Chapter 5: Index Analysis What-if Analysis

3 4 5

Enter a Workload Name, or click to load a list of available workloads, then select the name of the workload from the list. [Optional] Select the Index Tag for the workload if it exists. This allows you to simulate an index recommendation generated by a previous index analysis operation. [Optional] Select View Details. The View Details dialog box opens. For more information, see View Details Button on page 65.

6 7

Click Next. The What-If Analysis dialog box displays. The following table describes the buttons in the What-If Analysis dialog box.
Table 33: What-If Analysis Dialog Box Description

Button Add System Recommendations

Description Opens the View Details dialog box. Note: The Add System Recommendations button is enabled only if an Index Tag is specified in the Select Workload dialog box. The System Recommendations tab displays system-recommended indexes, and allows you to add one ore more of these indexes. The Reports tab enables you to view reports for workload statements, workload analysis, table scan, and existing indexes. The Workload Statements check box is selected by default. Select View to display the Workload Statements Report. This report shows the query IDs of the statements in the workload, the frequency of the statements as defined in the workload, and the text of the statements in the workload. Figure 24: Workload Statements Report

You can select any of the check boxes in the Reports tab to display additional reports for workload analysis, table scan, or existing indexes. For more information on these reports, see Chapter 6: Viewing Reports. Add Index DDL Remove Opens the What-If Analysis: Add Index dialog box where you can define indexes to simulate. See Table 34 on page 64. Removes any of the selected statements from the selected statements list. If you select the row number to highlight the row, the Remove button becomes enabled. To select multiple rows, press and hold the Shift key and then click the row number.

62

Teradata Index Wizard User Guide

Chapter 5: Index Analysis What-if Analysis


Table 33: What-If Analysis Dialog Box Description (continued)

Button Remove All Analyze Advanced

Description Removes all the statements from the selected statements list. Performs the analysis with the generated statements. Opens the Analysis Options dialog box that allows you to specify the cost parameters, random AMP samples, and statistics sample percentages used during the analysis. For more information, see Advanced Button on page 66.

Click Add Index DDL. The What-If Analysis: Add Index dialog box displays.
Figure 25: What-If Analysis: Add Index Dialog Box

Fill in the dialog box. The following table describes the fields and buttons in the What-If Analysis: Add Index dialog box.

Teradata Index Wizard User Guide

63

Chapter 5: Index Analysis What-if Analysis

Table 34: What-If Analysis: Add Index Dialog Box Description

Button DDL Type Create Index Drop Index Collect Stats Index Types Index Type

Description

Generates a CREATE INDEX DDL statement on the table and columns selected, depending on the index type selected. Generates a DROP INDEX DDL statement on the columns of the table selected. Generates a COLLECT STATISTICS statement on the columns of the table selected.

Select the index type. It can be either a secondary index, such as unique secondary index, non unique secondary index, hash ordered secondary index, or value ordered secondary index, or a join index. Specify if the join index is of this type. For definitions of these index types, see the Glossary on page 121. Note: These buttons are enabled when the index type selected is join index. Specify the join index name. Note: This field is enabled when the index type selected is join index.

Simple Global Aggregate Join Index Name Select Table

Select a table on which the index and statistics will be simulated. Select Column Select the column(s) on which the index and statistics will be simulated. The columns in this table will be dynamically loaded depending on the type of index selected. For Non Unique Secondary Indexes and Unique Secondary Indexes: Select the index columns from the grid. For Value Ordered Secondary Indexes and Hash Ordered Secondary Indexes: Select the index columns and the Order By column. You can select only one Order By column. Note: A column selected as an Order By column must also be selected as an index column. If this is not the case, Index Wizard automatically selects and adds that column to the index columns. For SIMPLE and GLOBAL Join Indexes: Select the columns for the join index and specify which of these columns make the primary index. For AGGREGATE Join Indexes: Select the columns for the join index. From the Aggregate Function column, select the aggregate function on the selected column(s) if you would like to have one and specify which of these columns would make the primary index. The columns in the Group By clause are determined by the selected non-aggregate columns. The order in the Group By clause is determined by the order in which they appear in the grid.

64

Teradata Index Wizard User Guide

Chapter 5: Index Analysis What-if Analysis


Table 34: What-If Analysis: Add Index Dialog Box Description (continued)

Button

Description Note: A column selected as a primary index within a join index must also be selected as a join index column. If this is not the case, it automatically gets selected and is added to the join index columns list.

Index DDL Index DDL The text in this box gets updated depending on the index type and columns selected. After you click Add, the index type and columns selected will be added to the parent dialog. Any missing value is represented by question marks (??). Select to add the Index and Statistics DDL to the What-If Analysis dialog box for simulation. Note: This button is enabled only after you have completed all the necessary actions in this dialog box, including any missing values. Refer to the Index DDL box if you have any missing values. 10 Click Add.

Add

A confirmation message displays indicating the specified DDL has been added. When the What-if Analysis is complete, the Analysis Results dialog box opens showing the analysis results. See What-if Analysis Results on page 70.

To handle Collect Statistics statements


If Collect Statistics statements are present in the DDL statement, the Statistics Information dialog box opens during the analysis.
1 2 3

[Optional] Set the dialog box as desired. Click Apply to apply the statistics. Close the dialog box to continue the analysis.

For more information on how to make changes in the analysis using this window, see Statistics Information Window on page 68.

View Details Button


Access the View Details button from the Select Workload dialog box or from the What-If Analysis dialog box using the Add System Recommendations button. From the Reports tab, view the workload details including reports for Workload Statements, Workload Analysis, Table Scan, and Existing Indexes. Select one or more check boxes, click View, and the reports display. From the System Recommendations tab, view the system recommendations in case the workload was analyzed earlier. The recommendations are read-only.

Teradata Index Wizard User Guide

65

Chapter 5: Index Analysis What-if Analysis

To view the statement text


From the View Details dialog box, right-click any statement and choose View DDL.

The View Statement dialog box opens and displays the complete index/statistics DDL text.
Figure 26: View Details Dialog Box and View Statement Dialog Box

Advanced Button
The Advanced button on the What-If Analysis dialog box opens the Analysis Options dialog box for you to modify the statistics collected for the tables in the workload during the What-if analysis. The dialog box has three tabs. The following table explains the fields and buttons in the Set Costs tab.
Table 35: Analysis Options Dialog Box: Set Costs Tab Description

Field/Button Cost Tag Comment Level

Description Selects the cost tag for which the cost parameters must be set. Shows the comment associated with the cost tag. Session: Sets the cost parameters at session level. IFP: Sets the cost parameters at IFP level. System: Sets the cost parameters at system level. Set: Sets the cost parameters. Reset: Resets the cost parameters.

Set/Reset

66

Teradata Index Wizard User Guide

Chapter 5: Index Analysis What-if Analysis Figure 27: Analysis Options Dialog Box: Set Costs Tab

The following table explains the fields and buttons in the Set RAS tab.
Table 36: Analysis Options Dialog Box: Set RAS Tab Description

Field/Button Database Name Table Name RAS Tag Level Set/Reset Select All

Description Displays the database name in which the table is present. Displays name of the table on which the random AMP samples must be set. Displays the RAS tag for the table. Sets RAS level at either the session or system level. Click to set the Set or Reset option. Click to select all RAS tags.

Teradata Index Wizard User Guide

67

Chapter 5: Index Analysis What-if Analysis

The following table explains the fields and buttons in the Set Statistics Samples tab.
Table 37: Analysis Options Dialog Box: Set Statistics Samples Tab Description

Field/Button

Description

View/Edit Statistics Sets the option to view/modify the statistics samples for the tables in the Samples workload. The default is Yes. Set Defaults Sets the default sample size for tables with the specified cardinalities.

Figure 28: Analysis Options Dialog Box: Set Statistics Samples Tab

Statistics Information Window


The What-if analysis starts after you click the Analyze button. During the analysis, the Statistics Information window opens if: Collect Statistics statements are present in the DDL statement, and The View/Modify Statistics Information Samples option is set to Yes in the Analysis Options - Set Statistics Samples dialog box.

68

Teradata Index Wizard User Guide

Chapter 5: Index Analysis What-if Analysis

To make changes to the what-if analysis


1

When the Statistics Information window opens, use the navigation pane to drill down to the specific table you want to view.
Figure 29: Statistics Information Window

The following table describes the information in the Statistics Information window.
2 3 4

Make the changes using the editable fields. Click Apply to apply the changes to the current analysis. Close the Statistics Information window to continue the analysis.
Table 38: Statistics Information Window Description

Field/Button Database objects Database Name Table Name Index Interval Type Column Name Number of Rows

Description The left pane of the window displays the hierarchy of the objects on which the statistics exist. Displays the database on which the table is present. Displays the table on which the statistics are collected. Displays the name of the index chosen. Selects the interval types to be displayed. The vales are All, High-biased, and Equal. Displays the column name on which the statistics are collected. Displays the number of rows in the table.

Teradata Index Wizard User Guide

69

Chapter 5: Index Analysis What-if Analysis


Table 38: Statistics Information Window Description (continued)

Field/Button Number of Nulls Number of Intervals

Description Displays the number of null values. Displays the number of intervals of statistics collected.

Number of Unique Displays the number of unique values for the column on which the statistics is collected. Version Time Stamp Minimum Value Mode Value Mode Frequency Sampled Sample Percent Other than 0 Intervals Displays the version. Displays the time stamp of the analysis. Displays the minimum value for interval 0. Displays the mode value of interval 0. Displays the mode frequency of interval 0. Indicates whether the statistics are sampled or not. Shows the percent of samples collected. Shows intervals other than 0.

What-if Analysis Results


When the what-if analysis finishes, the results are displayed in the Analysis Results dialog box. The dialog box shows the cost difference in percentage with and without the simulated/ removed indexes and/or statistics. It also shows the overall improvement in performance.
Figure 30: Analysis Results Dialog Box

70

Teradata Index Wizard User Guide

Chapter 5: Index Analysis What-if Analysis

The following table describes the fields and buttons in the Analysis Results dialog box.
Table 39: Analysis Results Dialog Box Description

Field/Button Query ID (Original) Query ID (Proposed) % Cost Improvement Statement Text Compare

Description Gives the query ID before the What-if analysis. Gives the query ID after the What-if analysis. Gives the percentage cost improvement of the statements after suggested indexes are simulated/deleted and/or statistics are simulated. Gives the text of the SQL statement. Click to compare the selected plans using Teradata Visual Explain. You must select each item separately to compare the plans for the different queries that are analyzed. Clicking this button opens the two plans in Teradata Visual Explain. This is disabled if Teradata Visual Explain is not installed on your system.

View Graph

Opens the Teradata Index Wizard-Performance Improvement Chart and generates a graph displaying the execution cost of the statements before and after the analysis. This button is enabled only after the analysis is done. The graph shows a statement-wise comparison of the estimated query costs. If the graph style is selected as Bar Graph, a bar graph appears (see Figure 31 on page 71). This is the default graph style. If the graph style is selected as Line Graph, a line graph appears.

Figure 31: Performance Improvement Chart

Teradata Index Wizard User Guide

71

Chapter 5: Index Analysis What-if Analysis

The statements can be compared visually using Teradata Visual Explain. To do this, select the plans to be compared, and click Compare. This opens Teradata Visual Explain and shows both plans visually.

What-if Analysis Process


The What-if analysis process starts when you click the Analyze button. The DDL statements in the grid are simulated on the system. Each DDL statement submitted is indicated in the status bar. If COLLECT STATISTICS statements are present in the DDL, a warning message appears. When you click OK, the statistics collected for the tables in the workload are displayed (the View/Modify Statistics Samples option must be set to yes). You can view the statistics and modify them. These statistics will be used during plan generation. The following table describes the statistics after they are generated.
Table 40: Analysis Statistics Dialog Box Descriptions

Field/Button Database objects Database Name Table Name Interval Type

Description Displays the hierarchy of the objects where the statistics exist. Displays the database where the table is present. Displays the table where the statistics are collected. Selects the interval types to be displayed. The values are All, High-biased, and Equal.

72

Teradata Index Wizard User Guide

Chapter 5: Index Analysis Index Analysis Summary


Table 40: Analysis Statistics Dialog Box Descriptions (continued)

Field/Button Column Name Number of Rows Number of Nulls Number of Intervals Number of Unique Version Time Stamp Minimum Value Mode Value Mode Frequency

Description Displays the column name where the statistics are collected. Displays the number of rows in the table. Displays the number of null values. Displays the number of intervals of statistics collected. Displays the number of unique values for the column where the statistics are collected. Displays the version. Adds a time stamp. Displays the minimum value for interval 0. Displays the mode value of interval 0. Displays the mode frequency of interval 0.

The workload statements are submitted to the server and the new plans are captured. During this phase, if the statistics were modified using the above option, the Optimizer uses the modified statistics. Otherwise, it uses the collected statistics while generating the plans. Additionally, the status bar displays the statement that is currently being processed. If you do not perform an abort, the new execution costs for the statements in the workload are obtained. The dialog box shows the cost difference in percentage with and without the simulated indexes and statistics, and the overall improvement of the performance. You can compare these statements using Teradata Visual Explain. Select the plans to be compared and click Compare.

Index Analysis Summary


The Index Analysis Summary window shows a summary of the analysis recommendation. See Figure 22 on page 60.

To view the analysis summary


1

Select View > Analysis Summary. The Index Analysis Summary window opens. The following table explains the information in the window.

Click OK to close the Analysis Summary window.

Teradata Index Wizard User Guide

73

Chapter 5: Index Analysis View Reports

Table 41: Index Analysis Summary Window Description

Field/Button Server Name QCD Name Workload Recommendations ID Start Time End Time Number of tables considered in the analysis. Numbers of tables on which indexes where recommended. Number of table on which indexes exist Number of statements considered for analysis Total elapse time

Description Displays the server name where the analysis is performed. Displays the QCD name. Shows the workload name. Displays the recommendations ID. Start time of the analysis. End time of the analysis. Shows the number of tables analyzed. Shows the number of table that received an index recommendation. Shows the number of table that have an index. Shows the number of statements that where considered for analysis. Shows the total time taken by Index Wizard for the analysis.

View Reports
Use the View Reports dialog box to select a previously created report.

To view a report from another workload.


1

Select Reports > Select Workload. The View Reports dialog box opens.

2 3 4 5

Select the QCD name, Workload, and Index Tag or click The workload appears in the field.

to search.

Right-click the workload statements in the field. The View Statement dialog box opens for you to view the statement text. In the Select Report list, click a report name to open the report of your choice or select All to view all reports. Click OK. The report(s) open.

74

Teradata Index Wizard User Guide

Chapter 5: Index Analysis View Reports

The following table describes the View Report dialog box options.
Table 42: View Report Dialog Box Description

Dialog Option QCD Name Workload Name Index Tag Statement Id Frequency Statement Text View Report

Description Displays the name of the QCD. Click Displays the list of workloads in the QCD. Displays the list of index tags for the workload, if present. Displays the statement ids of the statements in the workload. Displays the frequency of the statements as defined in the workload. Display the text of the statements in the workload. Select the report to be viewed. to search.

Teradata Index Wizard User Guide

75

Chapter 5: Index Analysis View Reports

76

Teradata Index Wizard User Guide

CHAPTER 6

Viewing Reports

Index Wizard creates a set of reports when a workload is created and a set after a workload is analyzed. Workload reports are designed to help you select tables within a workload to be analyzed. Analysis reports provide the data you need to make a decision about the index recommendation. Reports are managed using the Reports toolbar on the left side of the window (default position).

Workload Reports
Workload Reports provide information about the tables in a defined workload. The reports assist you in deciding which tables make the best candidates for an index analysis. Workload reports also provide a snapshot of table information which can be compared with report information after an analysis. The following reports are created when a workload is defined: Existing Indexes Report Update Frequency Report Table Usage Analysis Report Table Scan Report Workload Analysis Report Object Global Use Count Report

Analysis Reports
Analysis reports provide information about the results of the index analysis. They are designed to help you decide if the index recommendation is appropriate or not. The following reports are created after a workload is analyzed: Index Recommendation Report Query Cost Analysis Report Disk Space Analysis Report Summary Report Index Maintenance Cost Report

Teradata Index Wizard User Guide

77

Chapter 6: Viewing Reports Existing Indexes Report

Existing Indexes Report


The Existing Indexes Report provides a general view of the information about the table including index type, unique flags, and index names. This report is created when a workload is defined.

To open the existing indexes report


1

Select Reports > Current Workload > Existing Indexes... or From the Reports toolbar, select .

Use the Reports toolbar to manage the report. The following table explains the information in the report.
Table 43: Existing Indexes Report Description

Column Name Database Name Table Name Columns Index Type

Description Shows the name of the database. Shows the name of individual tables. Shows the list of columns (comma separated), which comprises the index. Shows the type of the index including: Primary Secondary Join Unique primary index Hash index Cover index Hash-ordered secondary index Value-ordered secondary index Partition primary index

Unique Flag Index Name Index Number Index Used

Indicates whether the index is unique or not. Shows the name of the index, if present. Shows the number of the index. Shows if an index is used in the workload.

78

Teradata Index Wizard User Guide

Chapter 6: Viewing Reports Update Frequency Report

Update Frequency Report


The Update Frequency Report shows the percentage statements within a table that are UPDATE statements. This report is created when a workload is defined.

To open the Update Frequency Report


1

Select Reports > Current Workload > Update Frequency... or From the Reports toolbar, select .

Use the Reports toolbar to manage the report. The following table explains the information in this report.
Table 44: Update Frequency Report Description

Column Name Database Name Table Name Update Percentage

Description Name of the database. Name of the table referenced in the workload. Table update percentage within the workload.

Table Usage Analysis Report


The Table Usage Analysis Report shows information on how often the table is accessed within the workload. A table with a high access number may have more potential for an index improvement. On the other hand, a table with a low access number may not need to be analyzed because its potential for a performance gain is limited. This report is created when a workload is defined or after the index analysis process.

To open the Table Usage Analysis Report


1

Select Reports > Current Workload > Table Usage... or From the Reports toolbar, select .

Use the Reports toolbar to manage the report. The following table explains the information provided by this report.

Teradata Index Wizard User Guide

79

Chapter 6: Viewing Reports Table Scan Report

Table 45: Table Usage Analysis Report Description

Column Name Database Name Table Name Statement Access Count

Description Shows the name of the database. Shows the name of the table. Indicates the number of statements in the workload that access a specific table.

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, etc. This report is created when a workload is defined.

To open the Table Scan Report


1

Select Reports > Current Workload > Table Scan... or From the Reports toolbar, .

Use the Reports toolbar to manage the report. The following table explains the information provided by the report.
Table 46: Table Scan Report Description

Column Name Database Name Table Name Rows Estimate Access Type

Description Shows the name of the database used to generate the report. Shows the table name. Estimates the number of rows in a table. Shows the type of access made on the table. Types include: All AMP Retrieve Single AMP Retrieve Two AMP Retrieve Group AMP Retrieve

Geography

Shows the geography of the relation. For example, it tells if the relation is hash re-distributed, built locally or duplicated to all AMPs.

80

Teradata Index Wizard User Guide

Chapter 6: Viewing Reports Workload Analysis Report


Table 46: Table Scan Report Description (continued)

Column Name Statement Text

Description Shows the text of the SQL statement for the individual table.

Workload Analysis Report


The Workload Analysis Report shows the cost estimate of a workload and the relative execution cost of a workload compared to the entire workload, statement text, frequency, and column types. The report also shows the tables and columns referenced, statements with clauses, and columns with join conditions. Note: For each statement, multiple rows exist in the report, one row per table. This report is created when a workload is defined.

To open the Workload Analysis Report


1

Select Reports > Current Workload > Workload Analysis... or From the Reports toolbar, select .

Use the Reports toolbar to manage the report. The following table explains the information in this report.
Table 47: Workload Analysis Report Description

Column Name Statement Type Cost Estimate (hh:mm:ss:sss) Relative Cost Database Name Table Name Value Access Columns Join Columns Range Access Columns Frequency

Description Shows the type of the statement. Shows the original cost of the statement with the recommended indexes. Shows the execution cost of the statement with respect to the execution cost of the entire workload. Shows the name of the database used to generate the report. Shows the tables accessed by the statement. Shows the columns accessed by the statement in the table. Shows the columns that are used in join conditions in the statements. Shows the columns accessed in range condition. Shows the frequency of the statement.

Teradata Index Wizard User Guide

81

Chapter 6: Viewing Reports Object Global Use Count Report


Table 47: Workload Analysis Report Description (continued)

Column Name Statement Text

Description Shows the text of the SQL statement.

Object Global Use Count Report


The Object Global Use Count Report provides object use count information to help identify objects most often accessed. This information helps identify tables that have a high potential for performance improvements. This report is created when a workload in defined.

To open the Object Global Use Count Report


1

Select Reports > Create Workload > Object Global Use Count or From the Reports toolbar, select .

Use the Reports toolbar to manage the reports. The following table explains the information provided in the report.
Table 48: Object Global Use Count Report Description

Column Name Database Name Object Name Object Type Columns

Description The name of the database that owns the object. Shows the object name. Indicates the object type, either Index, Table, or View. Shows the columns (comma separated) that comprise the index. Note: This is an empty string for the table and the view object types.

Index Type

Shows the type of index. Note: This is an empty string for the table and view object types.

Index Number

Displays the index number. Note: This is Zero for the table and view object types.

Global Use Count...

Displays the object use count of the objects available from the DBC.tables and DBC.indices views.

Last Access Timestamp Displays the Last Access Timestamp. Recommended for drop... This column is visible only when an index analysis is performed on a workload. This column shows YES if the index was recommended for DROP when the workload was analyzed.

82

Teradata Index Wizard User Guide

Chapter 6: Viewing Reports Index Recommendation Report

Index Recommendation Report


The Index Recommendation Report shows the recommended secondary index for each table if one is recommended. Use the information in this table to help you make a decision about whether the index recommended is appropriate or not. The report also suggests indexes that can be dropped. The statistics used for the analysis are saved in the Index Recommendations table. This report is created after a workload is analyzed.

To open the Index Recommendation Report


1

Select Reports > Current Workload > Index Recommendation... or From the Reports toolbar, select .

Use the Reports toolbar to manage the report. The following table describes the information provided in the report.
Table 49: Index Recommendation Report Description

Column Name Database Name Table Name Index Type

Description Shows the database for the table. Shows the name of the table on which the index was recommended. Shows the type of index recommended, for example a Hash-Ordered Secondary Index.

Size Estimates (KB) Shows the estimated size occupied by the index in the database. Time Estimate (hh:mm:sss:sss) Index DDL Stats DDL Shows the time estimate to actually create the recommended index. Shows the DDL statement text used to create/drop the index. Shows the DDL statements used to collect statistics.

Query Cost Analysis Report


The Query Cost Analysis Report shows the query cost of specific types of statements (SELECT, INSERT, DELETE) without the original recommended index and with the proposed recommended index. At the statement level, this allows you to see a percentage of how much a recommended index improves the query cost estimate. Costs are shown in time, with the difference shown as a percentage.

Teradata Index Wizard User Guide

83

Chapter 6: Viewing Reports Disk Space Analysis Report

The report also provides the SQL statements in the workload. Use the report to compare the execution cost with and without the recommended index at the query level. This report is created after a workload is analyzed.

To open the Query Cost Analysis Report


1

Select Reports > Current Workload > Query Cost Analysis... or From the Reports toolbar, select .

Use the Reports toolbar to manage the report. The following table explains the information in the report.
Table 50: Query Cost Analysis Report Description

Column Name Statement Type Original Cost Estimate (hh:mm:ss.sss) Proposed Cost Estimate (hh:mm: ss.sss) Percentage Change

Description The type of the SQL statement (SELECT, INSERT, DELETE.). The execution cost of the statement without the recommended index. The estimated execution cost of each statement type with the recommended index. The percentage increase/decrease of cost in executing the statement. The proposed cost may be higher than the original cost as statistics were used during the analysis and this may cause the Optimizer to make more accurate estimates. The index recommendations are still considered useful for the query. Number of recommendations given for the current statement. The text of the SQL statement.

No. of Index Recommendations Statement Text

Disk Space Analysis Report


The Disk Space Analysis Report shows the space estimate to store the recommended indexes. This information is helpful in databases where space is a factor. You may see performance improvements by using the recommended index, but it may take up too much space. This report is created after a workload is analyzed.

84

Teradata Index Wizard User Guide

Chapter 6: Viewing Reports Summary Report

To open the Disk Space Analysis Report


1

Select Reports > Current Workload > Disk Space Analysis... or From the Reports toolbar, select .

Use the Reports toolbar to manage the report. The following table explains the information provided by this report.
Table 51: Disk Space Analysis Report Description

Column Name

Description

Database Name Shows the name of the database used to generate the report. Table Name Index Definition Size (KB) Shows the name of the table. Indicates the index definition. Provides the estimated size of the index in kilobytes.

Summary Report
The Summary Report provides details about the secondary index counts and recommendation counts made in a specific analysis for all tables in the workload. This report is created after a workload is analyzed. The footnote on the report shows the statement count in the workload, number of tables accessed by the workload, and the time analysis. The report also shows the table name in which the index must be created or dropped and the DDL statement for creating/dropping the index. The statement text of the query ID can be viewed by right-clicking the QueryID column.

To open the Summary Report


1

Select Reports > Create Workload > Summary... or From the Reports toolbar, select .

Use the Reports toolbar to manage the report. The following table explains the information in this report.

Teradata Index Wizard User Guide

85

Chapter 6: Viewing Reports Index Maintenance Cost Report

Table 52: Summary Report Description

Column Name Query ID Database Name Table Name No. of Secondary Indexes No. of Join Indexes No. of Index Recommendations

Description The ID assigned to the query. Shows the name of the database. Shows the name of the table. Shows the number of existing secondary indexes. Shows the number of existing join indexes. Shows the number of index recommendations provided for the particular table. To view the DDL for the index recommendations, right-click on No. of Index Recommendations.

Index Maintenance Cost Report


The Index Maintenance Cost Report shows the estimated cost of maintaining recommended indexes for a particular recommendation ID on a workload. This report contains a row for every SQL statement and recommended index combination where maintenance costs are required for the index. This report is created after a workload is analyzed.

To open the Index Maintenance Cost Report


1

Select Reports > Current Workload > Index Maintenance Cost... or From the Reports toolbar, select .

Use the Reports toolbar to manage the report. The following table describes the information provided in the report. Note: This report will not contain any rows if none of the recommended indexes require any maintenance cost.
Table 53: Index Maintenance Cost Report Description

Column Name Database Name Table Name

Description Name of the database in which base table name is defined. The base table in the IndexRecommendations table on which the index is defined.

86

Teradata Index Wizard User Guide

Chapter 6: Viewing Reports Viewing Reports from Other Workloads


Table 53: Index Maintenance Cost Report Description (continued)

Column Name QueryID

Description The QueryID value of the SQL UPDATE statement. To view the corresponding workload statement, right-click on the QueryID.

Index Type Maintenance Cost (hh:mm:ss.sss) Index DDL

The type of recommended index. Estimated cost for updating the index structures. The DDL statement text of the recommended index.

Viewing Reports from Other Workloads


Use the View Reports dialog box to view reports created from other workloads. You can also use the Report buttons on the left-hand side of the Index Wizard interface. Report buttons become active when the report is available.

To view a report from another workload


1

Select Reports > Select Workload. The View Reports dialog box opens.

2 3 4 5

Select the QCD name, Workload, and Index Tag or click

to search.

The workload appears in the field. To view the statement text, right-click the workload statements in the field. In the Select Report list, click a report name to open the report of your choice. Click OK. The report opens. The following table explains the dialog box options.
Table 54: View Report Dialog Box Description

Option QCD Name Workload Name Index Tag Statement Id Frequency

Description Displays the name of the QCD. Click Displays the list of workloads in the QCD. Displays the list of index tags for the workload, if present. Displays the statement IDs of the statements in the workload. Displays the frequency of the statements as defined in the workload. to search.

Teradata Index Wizard User Guide

87

Chapter 6: Viewing Reports Viewing Reports from Other Workloads


Table 54: View Report Dialog Box Description (continued)

Option Statement Text View Report

Description Displays the text of the statements in the workload. Selects the report to be viewed.

88

Teradata Index Wizard User Guide

CHAPTER 7

Validating an Index Recommendation

Index validation is the process of checking to see if the recommended indexes actually improve system performance. Validation does not involve the actual execution of the recommendations, but permits the Teradata Optimizer to use the recommended indexes in the plan generation. If the recommendations are created with a COLLECT STATISTICS option, Index Wizard collects statistics on a sample size and saves them in the QCD. The sampled statistics are used during index validation. The validation process occurs in a simulated session mode. The index and the required statistics (as indicated by the recommendations) are simulated for the plan generation. Index recommendations are validated on the set of statements that were analyzed. The statements are submitted to the Teradata Database in a no execute mode. During validation, the query plans are saved into the specified QCD. Recommendations for the workload are loaded either from QCD or from a file. Validation topics include the following: The Validation Process Loading Recommendations from QCD Loading Recommendations from File Validation Results

The Validation Process


Validation can be done in any of the following ways: Analysis performed on the production system and validated on the production system. Analysis performed on the test system and validated on the production system. Analysis performed on the production system and validated on the test system. Analysis performed on the test system and validated on the test system.

Note: It is recommended that the last two options not be used during validation because the collected statistics are from the local system and a test system is usually an emulated production system where the table data does not exist. When the analysis and validation are performed on the same system, you can select the recommendations from the QCD and leave the Validate on Another System unchecked. When the analysis is performed on one system (test system) and the validation is performed on another system (production system), the following scenarios can occur:

Teradata Index Wizard User Guide

89

Chapter 7: Validating an Index Recommendation Loading Recommendations from QCD

The user is logged on to the system where the workload is analyzed and wants to validate on another system. In this case, check the Validate on Another System option in the Load Recommendations from QCD window to log on to the system on which validation must be done. Additionally, the recommendations can be loaded using either the QCD or the file, if they were saved at the time of analysis. The user is logged on to the system where the validation is to be performed. In this case, the recommendations can be loaded from QCD (if the analysis results are available on this system by importing of the recommendations earlier) or from the file that was saved at the time analysis was performed.

Loading Recommendations from QCD


The analysis recommendations are stored in the QCD. The recommendations can be validated to see whether there is an improvement in the performance of the system in executing the statements of the workload.

To load recommendations from the QCD


1 2

Select Validation > Load Recommendation from QCD. The Recommendations from QCD dialog box opens. See Table 55 for more information. From the drop-down list box, select the QCD Name, Workload Name, and Index Tag. or Click to load the QCD Name and click load the workload name and index tag. located next to the Workload Name to

3 4 5 6 7 8

If you select Validate on Another System, you will be prompted to log on to another system. Click Next. The Index Validation dialog box opens. See Table 56 for more information. Click View Workload to check to ensure the index is correct. Click the Data Sampling to set the validation sampling criteria. Click the View DDL to view DDL statements. Click Validate to start the validation.
Table 55: Recommendations from QCD Dialog Box Description

Field/Button QCD Name Workload Name Index Tag

Description Displays the QCD name where the validation must be performed. This will be the QCD on which the recommendations are validated. Displays the name of the workload. Displays the name of the index tag.

90

Teradata Index Wizard User Guide

Chapter 7: Validating an Index Recommendation Loading Recommendations from QCD


Table 55: Recommendations from QCD Dialog Box Description (continued)

Field/Button Browse () button

Description Browses the system for the list of QCDs. This button is enabled only if the Validate on Another System option is checked. When this button is clicked, you are prompted to log on to the system on which the workload must be recreated. Accepts the inputs and loads the recommendations in the Index Validation dialog box. If the Validate on another system check box is selected and you have not logged on to the target system, a Logon dialog box appears. Indicates the validation is to be performed on another system. When checked, Index Wizard prompts you to log on to another system.

Next

Validate on Another System

Table 56: Index Validation Dialog Box Description

Field/Button Target QCD

Description Displays the QCD name where the validation must be performed. This will be the QCD on which the recommendations are validated. This field is enabled only if the Validate on Another System check box is selected.

View Workload Table Name Index Columns Index DDL Stats DDL Select All Deselect All Data Sampling View DDL Validate

Select this button to ensure the index is correct. Displays the table in which the recommendation is made. Displays the list of columns in which the recommendation is made. Displays the text of the index recommendations Displays the text of the statistics DDL statement. Selects all the recommendations in the list for validation. Deselects all the selected recommendations in the list. Shows a view of the data sample size for the statistics to be considered for the tables during validation. Shows a view of the text of all the recommendations. Starts the validation of the indexes on the specified system.

When the validation starts, a new data source is created for the specified system if you selected the Validate on Another System check box. After you click Validate, the system recommendations are simulated on the system and the execution plans for the statements in the workload are captured. During this time, the Progress - Simulating Recommendations and Capturing Execution Plan progress bars are shown. The difference in the execution time of the statements is calculated and overall cost difference for the workload is calculated.

Teradata Index Wizard User Guide

91

Chapter 7: Validating an Index Recommendation Loading Recommendations from File

For information about the Validation Results window, see Validation Results on page 92.

Loading Recommendations from File


You can load a recommendation from a saved recommendation plans.

To load a recommendation from a file


1 2 3

Select Validation > Load Recommendations from File. The Select a File for Validation dialog box opens. Select or browse for the file to load recommendations, and click Open. The Select Workload dialog box opens. Click Next to load the recommendation. For an explanation of all the fields in the Validation window, see Loading Recommendations from QCD on page 90.

When recommendations are loaded from a file, the plans are first imported on the system where the validation is performed. This option can be accessed by selecting the Load Recommendation from File option from the Validation menu. When you click the Validate button, the process is confirmed, the validation process starts, and the results of the validation are displayed in the Validation Results window. See Validation Results on page 92 for more information on validation results.

Validation Results
The Validation Results window: Shows the results of the validation and the query IDs of the statements before and after validation. Shows the system where the recommendations were made and the system where the validation was completed, along with the overall cost difference in executing the workload before and after validation. Displays the details of the tables involved in validation, their cardinalities and the statistic sample size considered for validation.

92

Teradata Index Wizard User Guide

Chapter 7: Validating an Index Recommendation Validation Results Figure 32: Validation Results Window

The following table explains the information in the Validation Results window.
Table 57: Validation Results Window Description

Window Option Sample Size area Table Name Cardinality

Description

Displays the name of the table where the recommendation is made. Displays the cardinality of the table.

% Sample on which Displays the percentage of the sample where the statistics were collected for statistics were collected the recommended index. Results area Query ID (without recommendations) Query ID (with recommendations) Displays the query ID before index validation. Displays the query ID after validation.

Teradata Index Wizard User Guide

93

Chapter 7: Validating an Index Recommendation Validation Results


Table 57: Validation Results Window Description (continued)

Window Option % Cost Improvement Statement Text Source System Validated System Conclusion Compare View Graph

Description Displays the percentage cost improvement of the statements after index validation. Displays the text of the SQL statement. Displays the system name where the analysis was performed along with the QCD name. Displays the system name where the validation was performed along with the QCD name. Displays the average cost of queries that used simulated indexes. Opens Teradata Visual Explain and visually compares the plans selected in the results grid. Generates the graph displaying the execution cost of the statements before and after the validation. The graph shows a statement-wise comparison of the estimated query costs.

94

Teradata Index Wizard User Guide

CHAPTER 8

Executing Recommendations

Index Wizard has an execute recommendation feature that allows you to execute index recommendations immediately or schedule them for a later time. This feature works in conjunction with Teradata Dynamic Query Manager (Teradata DQM) to schedule the execution of recommendations. Executing a recommendation applies the index recommendations to the production database. It is highly recommended that index recommendations be validated before executing. For more information, see Chapter 7: Validating an Index Recommendation. The following topics are covered in this section: Executing a Recommendation Immediately Schedule Recommendation Schedule Recommendation Errors

Executing a Recommendation Immediately


The execute immediately option allows you to apply an index recommendation immediately to a production system.

To execute a recommendation immediately


1 2 3

Select Creation > Execute Immediately. The Execute Recommendations dialog box opens. Fill in the dialog box as needed. The following table describes the fields and buttons in this dialog box. Click Execute to begin the execution process.
Table 58: Execute Recommendation Dialog Box Description

Fields/Buttons QCD Name Workload Name Index Tag Table Name

Description Enter the QCD name or click to display a list. to display the list of

Enter the name of the Workload or click workloads in the QCD. Select an index tag.

Shows the table name where the recommendation must be executed.

Teradata Index Wizard User Guide

95

Chapter 8: Executing Recommendations Schedule Recommendation


Table 58: Execute Recommendation Dialog Box Description (continued)

Fields/Buttons Statement Text Select All Deselect All Execute

Description Displays the DDL text of the index recommendations, as well as COLLECT/DROP STATISTICS statements. Selects all the recommendations. Deselects all the recommendations. Executes the selected recommendations and displays the results of the execution.

Execution Results Window


After the recommendations are executed, the results of the execution are displayed in the Execution Results window. The following table explains the information in this window.
Table 59: Execution Results Window Description

Option Table Name Result

Description Displays the table name where the recommendation was created. Displays the result of whether the recommendation was executed successfully or an error was encountered. If an error was encountered, the error message is displayed. Displays the DDL text of the index.

Index DDL

Schedule Recommendation
Index Wizard allows you to schedule when an index recommendation is applied to the production database. This feature uses Teradata Query Scheduler to schedule requests. Note: The schedule recommendation feature only works with Teradata Query Scheduler 6.0. and above. If Creation > Schedule Recommendations is dimmed, Teradata Query Scheduler might not be installed or properly set up. For more information, refer to the Teradata Query Scheduler Administrator Guide. See Additional Information on page v.

To schedule a recommendation
1

Select Creation > Schedule Recommendations.

96

Teradata Index Wizard User Guide

Chapter 8: Executing Recommendations Schedule Recommendation

The Select Recommendations dialog box opens.


Figure 33: Select Recommendations Dialog Box

Fill in the dialog box as follows.


Table 60: Select Recommendations Dialog Box Description

Dialog Box Option QCD Name Workload Name Index Tag Table Name Statement Text Select All Deselect All 3

Description Enter the QCD name or click to display a list. to display the list of

Enter the name of the Workload or click workloads in the QCD. Select an Index tag.

Indicates the table name where the recommendation must be executed. Displays the DDL text of the index recommendations, as well as COLLECT/DROP STATISTICS statements. Selects all the recommendations. Deselects all the recommendations.

Select the recommendation to be executed, and click Next.

Teradata Index Wizard User Guide

97

Chapter 8: Executing Recommendations Schedule Recommendation

The Schedule Recommendations dialog box opens.


Figure 34: Schedule Recommendations Dialog Box

Fill in the dialog box as follows.


Table 61: Schedule Recommendations Dialog Box Descriptions

Dialog Box Option Scheduling Options Request Name User ID Start Date Start Time

Description Specifies the parameters for scheduling the recommendations. Type a name for the request. Indicates the User ID on which the Teradata Query Scheduler session was created. This is the same as the current user ID specified at logon. Specify the date when the recommendations is to be executed. Specify the time when the execution of the recommendations begins.

Maximum Wait Time Specify the maximum time up to which the start of execution can be deferred if an execution window is not available at the specified time. 5 6 7

Click Schedule to schedule the recommendation at the specified date and time. A message appears with the Request Id number and Job Id number. Make note of these numbers, and click OK. To view your request, open the Teradata Query Scheduler Viewer. Look in the list for your Request Id and Job Id numbers. Note: If you receive an error, see Schedule Recommendation Errors on page 99.

98

Teradata Index Wizard User Guide

Chapter 8: Executing Recommendations Schedule Recommendation Errors

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.
Table 62: Schedule Recommendation Errors

Error Unable to create a session

Explanation To schedule the recommendations, Teradata Query Scheduler session needs to be created.

Remedy Ensure the server service is started and retry. From the Teradata Query Scheduler Operations window, select Server > Start. Refer to Teradata Query Scheduler User Guide for information on the Scheduler Operations window.

Scheduling request is currently restricted Scheduler execution time frames are not currently available

This error occurs when the Teradata Query Scheduler Administrator setting for Enable Scheduling is not selected.

From the Teradata Query Scheduler Administrator window, select Configuration > Enable Scheduling.

The execution time frames of Teradata Query From the Teradata Query Scheduler Administrator window, select Configuration > Scheduler Administrator's Configuration Execution Time Frames. settings are not configured for the specified time. There is no window available to schedule the request in the specified time. 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.

Failed to get scheduling information

For information on Teradata Query Scheduler, refer to Teradata Query Scheduler Administrator Guide and Teradata Query Scheduler User Guide. See Additional Information on page v.

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 2 3 4

Start Teradata Query Scheduler Administrator. Select Configuration > Enabled Scheduling to ensure scheduling is enabled. Select Configuration > Execution Time Frames. The Execution Time Frames dialog box opens. In the Time Frame Names field, highlight the entry you want to change, and click Edit. The Time Frame Properties dialog box opens.

Teradata Index Wizard User Guide

99

Chapter 8: Executing Recommendations Schedule Recommendation Errors 5

Ensure the following fields are set: Enable Time Frame option is checked. Every Day or a Day option is checked. Time From and Time To is set between 0 to 24.

6 7

Click OK to close the Time Frame Properties dialog box. Click Close to close the Execution Time Frames dialog box.

100

Teradata Index Wizard User Guide

CHAPTER 9

Index Wizard Tools

Index Wizard has a set of tools that help you connect to the Teradata Database, work with index recommendations, and set Index Wizard preferences. The following topics are part of the Index Wizard Tools menu. Executing SQL Feature Working With Other Teradata Client Tools Preferences Index Analysis Inputs

Executing SQL Feature


The Execute SQL feature allows you to execute SQL statements either from the Index Wizard interface, called the Execute SQL- Query window, or through Teradata SQL Assistant. Teradata SQL Assistant opens by default. To use Teradata SQL Assistant to execute queries, see the Teradata SQL Assistant for Microsoft Windows User Guide for information about this application. See Additional Information on page v. Before using the Index Wizard Execute SQL - Query window, you must follow the procedure, To select the Execute SQL - Query Window. Note: The native Execute SQL - Query window uses the same session as Index Wizard. It also displays a history of recent queries. If you use Teradata SQL Assistant, a new session is created.

To select the Execute SQL - Query Window


1 2 3

Select Tools > Options > Preferences. Select the General tab. Clear the check box Use SQL Assistant instead of Execute SQL Query window. Now, when Execute SQL is selected, Index Wizard opens the Execute SQL - Query window instead of Teradata SQL Assistant.

To use the Execute SQL - Query Window


1

Select Tools > Execute SQL. The Execute SQL - Query window opens.

Teradata Index Wizard User Guide

101

Chapter 9: Index Wizard Tools Executing SQL Feature 2

Type SQL statements in the Query window. or Click a statement in the History window.

3 4

To open a saved SQL statement and insert it in the Query window, select File > Open Query. Execute a query by selecting File > Execute Query. or From the toolbar, click .

The results appear in the Results Set window.


Figure 35: Execute SQL - Query Window

102

Teradata Index Wizard User Guide

Chapter 9: Index Wizard Tools Working With Other Teradata Client Tools

Working With Other Teradata Client Tools


Index Wizard is designed to work with other client tools to provide the DBA with the toolset necessary to fine tune the database to maximum efficiency. The tools Index Wizard works with include: Teradata System Emulation Tool Teradata Visual Explain Teradata Statistics Wizard Teradata SQL Assistant

These applications can be started from Index Wizard by clicking the respective buttons on the toolbar or selecting them from the Tools menu. Teradata Visual Explain also starts when the Compare button is clicked during the index validation process. Applications opened from Index Wizard automatically connect to the same database. Note: Statistics Wizard can be started from Index Wizard but does not automatically connect to the same database.

To open client tools


1 2

From the Tools menu, choose the tool you want to open. The application you chose opens.

For information about how to use the application, refer to the Help menu or the user guide. See Additional Information on page v.

Preferences
The Preferences window allows you to set the connectivity type, default directory for saved files, and several other options. They include the QCD Access option, Execute SQL option, and the Data Demographics capture option. For more information on connecting using ODBC or WinCLI see the following: Connecting Through ODBC on page 18 Connecting Through WinCLI on page 19

To change preferences
1

Select Tools > Options > Preferences. The Preference dialog box opens.

Teradata Index Wizard User Guide

103

Chapter 9: Index Wizard Tools Index Analysis Inputs 2 3

Use the tabs to select the setting you want. The following table explains each tab in the dialog box. Click OK.
Table 63: Preferences Dialog Box Description

Options Connectivity tab ODBC WinCLI

Description

Select this option to create a connection using ODBC. For more information, see Connecting Through ODBC on page 18. Select this option to create a connection using WinCLI. For more information, see Connecting Through WinCLI on page 19.

Path tab Default Directory Enter the directory where you want files stored when saved. Use the Browse (...) button to browse.

General tab Use QCD information captured by logged on user only Use SQL Assistant instead of Execute SQL Query window Capture demographics to objects referred in workload Select sample size for statistics collection Check this box to set Index Wizard to use only information captured by the logged on user.

Check this box to have Teradata SQL Assistant execute SQL statements (default). Check this box to have Index Wizard capture additional information for Data Demographics. This option is used when a workload is created by using statement text or by using the DBQL. Select the sample size (percentage) to be used for statistics collection during query capture when defining a workload from DBQL statements or using SQL statement text. The default is 100.

Index Analysis Inputs


With Index Wizard, you can set different input parameters for an analysis. Input parameters are also explained in Advanced Index Parameters on page 55.

To set index analysis inputs


1

Select Tools > Options > Index Analysis Inputs

104

Teradata Index Wizard User Guide

Chapter 9: Index Wizard Tools Index Analysis Inputs

The Index Analysis Parameters dialog box opens.


2 3

Fill in the dialog box. See Table 32 on page 56 which explains the options in this dialog box. Click OK. The inputs take effect on the currently loaded workload.

Teradata Index Wizard User Guide

105

Chapter 9: Index Wizard Tools Index Analysis Inputs

106

Teradata Index Wizard User Guide

CHAPTER 10

Data Demographics

The Data Demographics window visually depicts the demographics of a selected table, its subtables, and statistics in its stat fields. This same window is used in Teradata Visual Explain and Teradata System Emulation Tool. Demographic information is presented in a graphical format such as bar graphs or line graphs and in a report form.

Data Demographics Window Overview


Open the Data Demographics window through the Index Analysis dialog box. A workload must be defined to start a new analysis. The Data Demographics window shows several different graphs of information about the selected table. For a list of specific graphs, see Data Demographics Graph Types on page 111. Each type of information is also viewable in report form. Graphs and reports can be saved and printed.

To open the Data Demographics Window


1 2

Start a workload analysis by selecting Analysis > New Analysis. The Index Analysis dialog box opens showing the current workload. Right-click the Table Name column in the Select Tables field, and click the Data Demographics. The Data Demographics window opens. See the following figure.

To learn how the Data Demographics window works, see Data Demographics Window Controls on page 109

Teradata Index Wizard User Guide

107

Chapter 10: Data Demographics Data Demographics Window Overview Figure 36: Data Demographics Window

The Data Demographics Menu Options


The Data Demographics window displays information about a selected table in graphical or report form. The window gives you several ways to view and manage the information. The following table describes how to use the Data Demographics menu options.
Table 64: Data Demographics Menu Descriptions

Menu Item File menu

Description/ Function Use to print, save as, print preview, close.

108

Teradata Index Wizard User Guide

Chapter 10: Data Demographics Data Demographics Window Overview


Table 64: Data Demographics Menu Descriptions (continued)

Menu Item View menu

Description/ Function Set Font- sets the fonts for reports. Restore Default Preferences- restores the default preferences. Change Graph Settings- changes the type of graph displayed. Change Graph Perspective- change the perspective of a 3D graph. Fit in Window- fit the graph in the current window size. Actual Size- shows the graph in its actual size.

Use these controls to move from view to view. First Page Previous Page Current Page Next Page Last Page

Fit in Window- fit the graph in the current window size. Actual Size- shows the graph in its actual size. Graphs menu Report menu Preferences menu Selects the type of graph you want to see. View each type graph in report form. Sets the preferences for each type of graph.

Data Demographics Window Controls


Use the controls in the Data Demographics window to manage the different types of information available. The controls are explained as follows. Selecting Bar or Line Graphs Graphs can be presented using lines, 2D bars, or 3D bars. Use the Bar/Line drop-down menu to select the type you want. Each type of bar graph and line graph has additional options that can be selected from the additional drop-down box, shown below.

Graph options are shown in the following table.


Table 65: Bar and Line Graph View Options

Graph Type Bar2D and Bar3D Bar Graphs

Descriptions barStacked- shows the graph bars stacked on top in each other. barZClustered- shows the bar graphs side by side.

Teradata Index Wizard User Guide

109

Chapter 10: Data Demographics Data Demographics Window Overview


Table 65: Bar and Line Graph View Options (continued)

Graph Type Line Graphs

Descriptions lineLines- shows simple line for the line graph. lineSymbols- uses symbols to highlight graph points. lineSticks- uses colored sticks to indicate graph points.

Changing Bar Graphs You can also change graph settings using the Change Graph Settings dialog box in the View menu. Move Through Table Pages You can navigate through different pages of a graph by specifying the X-axis range in the edit box next to the page controls. Specify the range as follows: <Minivalue><Maxvalue>. For example, 2-3. Move forward or backward through table graphs using the arrow buttons, shown in the following figure. The buttons allow you to move to the next page, previous page, last page and first page.
Figure 37: Navigation Controls for Table Graphs

To change graph type


Use the Graph Type drop-down menu to select a type of graph you want.

To change report type


Use Report on the menu bar to select a report you want to view.

To change the graphic perspective


When the Bar graph is set to 3D, you can change the perspective of the graph.
1

Click Perspective (as shown to the right) The Graph Perspective controller opens.

Use the sliders to change the graph perspective.

You can also open the Graph Perspective controller by selecting View and clicking Change Graph Perspective.

110

Teradata Index Wizard User Guide

Chapter 10: Data Demographics Data Demographics Graph Types

To change graph preferences


Each type of graph has a Settings dialog box used to set parameters for the graph display.
1 2

Select Preferences and choose the graph you want to change. Fill in the dialog box as needed, and click OK.

Data Demographics Graph Types


There are several types of information graphs available in the Data Demographics window. Each depicts information visually using bars or lines and in a report form. Each graph can be printed and saved for presentations or reports. The type of information graphs include: Disk Space Utilization Graph Spool Space Utilization Graph Row Count/Avg. Row Size Graph Blocks Distribution Graph Statistics Details Graph

Disk Space Utilization Graph


The Disk Space Utilization graph shows the disk space utilization of the table on the AMPs in the system.

To open the disk space utilization graph


In the Data Demographics window, select Graphs > Disk Space Utilization.

To change the settings for the disk space utilization graph


Click Preferences > Disk Space Utilization.

The following table describes the Disk Space Utilization buttons.


Table 66: Disk Space Utilization Button Descriptions

Button

Description Opens the Disk Space Utilization graph.

Opens the Disk Space Utilization graph in a report form.

Teradata Index Wizard User Guide

111

Chapter 10: Data Demographics Data Demographics Graph Types

To open the disk space utilization report


Select Reports > Disk Space Utilization.

Spool Space Utilization Graph


The Spool Space Utilization graph shows the spool space use of the table over the AMPs in the system.

To open the spool space utilization graph


Select Graphs > Spool Space Utilization.

To change the settings of the spool space utilization graph


1 2

Click Preferences> Spool Space Utilization. The Spool Space Utilization Settings window opens. Set the options, and click OK.
Table 67: Spool Space Utilization Button Descriptions

Button

Description Opens the Disk Spool Space Utilization graph.

Opens Spool Space Utilization graph in a report form.

To view the spool space utilization report


Select Reports > Spool Space Utilization.

Row Count/Avg. Row Size Graph


The Row Count/Avg. Row Size graph row distribution of the tables (and sub-tables) over the AMPs in the system. The sub-table for the table can be selected from the Standard box.

To open the row count/avg. row size graph


Select Graph > Row Count/Avg. Row Size.

112

Teradata Index Wizard User Guide

Chapter 10: Data Demographics Data Demographics Graph Types

To view the report form of this graph


From the Report menu, select Row Count/Avg. Row Size.
Table 68: Row Count/Average Row Size Button Descriptions

Button

Description Opens the Row Count/Avg. Row Size graph.

Opens the Row Count/Avg. Row Size graph in a report form.

Blocks Distribution Graph


The Block Distribution graph shows block distribution of the selected tables (or sub-tables) over the AMPs in the system.

To open the blocks distribution graph


Select Graph > Blocks Distribution.

To view the report form of this graph


From the Report menu, select Blocks Distribution.
Table 69: Blocks Distribution Button Descriptions

Button

Description Opens the Blocks Distribution graph.

Opens the Blocks Distribution graph in a report form.

Statistics Details Graph


The Statistics Detail graph shows the statistics of the specified column or index of the table.

To view the statistics collected on the table or sub-table


From the Graph menu, select Statistics Details.

Teradata Index Wizard User Guide

113

Chapter 10: Data Demographics Data Demographics Graph Types

Table 70: Statistics Details Button Descriptions

Button

Description Opens the Statistics Detail graph.

Opens the Statistics graph in a report form.

The Statistics Details graph shows three levels of details of the selected table. The following table shows the buttons used for each level and explains the level.
Table 71: Statistics Details Graph Button Descriptions

Type of Detail Summary Statistics Equal Height Statistics High Bias Column Statistics

Button

Description Shows a summary of the statistics on the selected tables.

Shows equal heights statistics.

Shows high bias column statistics.

114

Teradata Index Wizard User Guide

APPENDIX A

Command Line Interface

Teradata Index Wizard provides a command line interface.

Invoking the GUI


To invoke the GUI
Use tiwiz -g on the command line to invoke the Index Wizard GUI.

Opening Parameters
To open parameters from a file
Use tiwiz -f on the command line if you want Index Wizard to read different

parameters.

Command Line Interface Syntax


<command line> ::= tiwiz <logon specification> <workload details> [<index nametag> <index analysis parameters> [<restart parameters>] ] [<gui options>] [<output options>]

<logon specification> ::=[-l <tdpid>\<User Name>,<password> for CLI | -c <ODBC DSN>\<password> for ODBC ] [-am <authentication mechanism>\<authentication parameter>] [-scs <session character set>] <workload details> ::= q <QCDName> -w <WorkloadName> -id <qid1> [, <qid2>,...] [-fr <freq1> [, <freq2>,...]]

Teradata Index Wizard User Guide

115

Appendix A: Command Line Interface Command Line Options

<index nametag> ::= -i <IndexName> <index analysis parameters> ::= <index analysis parameter> [ <index analysis parameter> ...] <index analysis parameter> ::= -q <QCD Name> -w <Workload Name> -TB .<TableName>.[{,.<TableName>.}...] -KI -MC <number> -MI <number> -CR <number> -SS <number> <restart parameters> ::= -ch <CheckPointFrequency> <output options> ::= -o <FileName> <gui option> ::= -g

Command Line Options


The following tables describe Index Wizard command line options:

Command Line Options for Log on Information


The list of command line arguments to specify log on information are given in the following table (all options are case-sensitive).
Table 72: Command Line Options for Logon Information

GUI Option

Command Line Option

Remarks <tdpid> is a valid Teradata server name. This name should be defined in the Hosts file. This option is mandatory. <username> is a valid user name through which the user logs in. This option is mandatory. <password> is the password for the user name. This option is mandatory. <ODBC DSN> is the data source name to be selected for ODBC. The password must be supplied if the password is not stored when the DSN is created. <authentication mechanism> is the authentication mechanism to connect to a database. This option is not mandatory. <authentication parameter> is the authentication parameter to connect to a database. This option is not mandatory. <session character set> is the session character set to connect to a database. This option is not mandatory.

Enter the Teradata <tdpid> server name Enter the username Enter the password Select the DSN (for ODBC) Enter the authentication mechanism Enter the authentication parameter Enter the session character set <username> <password> <ODBC DSN>

<authentication mechanism> <authentication parameter> <session character set>

116

Teradata Index Wizard User Guide

Appendix A: Command Line Interface Command Line Options

Command Line Options for Defining a Workload


The list of command line arguments to select the method of defining the workload are given in the following table (all options are case-sensitive).
Table 73: Command Line Options for Defining a Workload

GUI Option Select workload from the QCD

Command Line Option -q <QCDName>

Remarks <QCDName> specifies the query capture database name in which the workload is defined or from which the workload must be selected. This option is mandatory. <WorkloadName> is the name of the workload. If it has special characters with respect to the command line, the name must be enclosed within double quotes. This option is mandatory. <qid1>, <qid2>, are the query ids to be added for the workload. <freq1>, <freq2> are the frequencies corresponding to the query ids. If no frequency is specified for a query id, the frequency is taken as 1. The first frequency corresponds to the first query id.

-w Specifying the workload name for <WorkloadName> new workload definition Enter the Query ids Enter the frequency -id <qid1> [, <qid2>,] -fr <freq1> [, <freq2>,]

Command Line Options for Inputs to Index Wizard


The list of command line arguments for specifying the input parameters for index analysis are given in the following table (all options are case-sensitive).
Table 74: Command Line Options for Inputs to the Wizard

GUI Option Index name tag QCD Name

Command Line options -i <IndexNameTag> -q <QCD Name>

Remarks <IndexNameTag> is the name with which the index recommendations are saved in the QCD. <QCD Name> is the QCD on which the analysis must be performed. <Workload Name> is the workload, which must be analyzed. <Table name> is the table name for which indexes have to be recommended. This is optional. Used to keep the existing indexes in the tables of the workload. <number> is the maximum number of columns in an index (between 1 and 16). This is optional.

Workload Name -w <Workload Name> Table list Keep existing indexes Maximum columns per index -TB "<TableName>" [{, "<TableName>"}] -KI -MC <number>

Teradata Index Wizard User Guide

117

Appendix A: Command Line Interface Command Line Options


Table 74: Command Line Options for Inputs to the Wizard (continued)

GUI Option Maximum columns per join index Maximum index per table Maximum number of candidates to be searched Threshold change rate Index maintenance mode

Command Line options -JC <number>

Remarks <number> is the maximum number of columns in a join index (between 1 and 16). <number> is the maximum number of indexes per table (between 1 and 32). This is optional. <number> is the maximum candidates to be searched (between 128 and 512). This is optional.

-MI <number> -SS <number>

-CR <number>

<number> is the change rate below which the columns would be considered for indexes (between 0 and 9). This is optional. <number> is the index maintenance mode value. Choose from the following values: 0 = Off 1 = Report Only 2 = Evaluate For a description of these values, see Table 32 on page 56. This is optional.

-IM <number>

Restart parameters

-ch <CheckpointFrequency>

<CheckpointFrequency> is the number of queries analyzed after which the checkpoint information is saved in the QCD.

Command Line Options for Specifying Output File Name


The command line argument for specifying the output file name is given in the following table (the option is case-sensitive).
Table 75: Command Line for Specifying Output File Name

GUI Option Enter the file name for capturing output

Command Line Option -o <file name>

Remarks <file name> is the name of the file in which the output of the analysis must be stored.

118

Teradata Index Wizard User Guide

APPENDIX B

Index Wizard Error Messages

Index Wizard may display error messages during the different operations. To get information about the error you are receiving, see: Error Messages Errors While Defining a Workload Handling Errors

Refer to Messages for additional information on error messages. See Additional Information on page v.

Error Messages
The following table explains the error you may receive while using Index Wizard.
Table 76: Error Messages

Error Error in Teradata Database name Error in user name Error in password The QCD mentioned does not exist The control files required for importing the production system environment do not exist. Error in loading recommendations from file, if file is invalid. Error in allocating memory. Error in creating recommendations file Error in opening registry

Message ODBC name not found - possible HOSTS file problem. User Identification is not authorized. Invalid password. Database 'xxxx' does not exist. Teradata System Emulations Tool control files do not exist. Index Wizard cannot read the file: <filename>. This is not a valid Index Wizard recommendation file. Out of memory. Error in creating file: <filename> Unable to open registry.

Teradata Index Wizard User Guide

119

Appendix B: Index Wizard Error Messages Error Messages

120

Teradata Index Wizard User Guide

Glossary

A
administrator A special user responsible for allocating resources to a community of users. 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. aggregate join index An aggregate join index is a database object created using the CREATE JOIN INDEX statement, but specifying one or more columns that are derived from an aggregate expression. Define an aggregate join index as a join index that specifies SUM or COUNT aggregate operations. No other aggregate functions are permitted in the definition of a join index; however, most of the other simple aggregate statistics can be derived from these using column expressions. You can create aggregate join indexes as either single-table or as multiple join indexes. Aggregate join indexes can also be sparse.

C
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. 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.

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, prerelational 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.

Teradata Index Wizard User Guide

121

Glossary

data dictionary In the Teradata Database, the information automatically maintained about all tables, views, macros, databases, and users known to the Teradata Database system. It includes information about ownership, space allocation, accounting, and access right relationships between those objects. Data Dictionary information is updated automatically during the processing of Teradata SQL data definition statements. It is used by the parser to obtain information needed to process all Teradata SQL statements. data manipulation language (DML) In Teradata SQL, the statements and facilities that manipulate or change the information content of the database. These statements include INSERT, UPDATE, and DELETE. data source name (DSN) Through a data source name, the ODBC driver for Teradata maps a logical name to the necessary software components and any additional information required for accessing the Teradata Database. The user chooses the DSN. The DSN should be a name that reflects the type of data or system it represents. 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) over a period of time. DBA A historical record of SQL statements that are run in Teradata

Acronym for database administrator

domain name A group of computers whose hostnames (the unique name by which a computer is known on a network) share a common suffix, that is the domain name.

E
export This refers to extracting or transferring system information from the tables and views of a given Teradata Database and saving it so it can be manipulated or pulled into another system. field The basic unit of information stored in the Teradata Database. A field is either null, or has a single numeric or string value.

F
frequency The number of times a particular statement exists within a workload.

G
global join index Also known as a global index. It is a single-table join index, except for one important difference: each global index row carries a pointer to its base table that can be used as an alternate way to access base table rows. Using a join index for base table access is referred to as partial covering because such a join index only partially covers the query. globally distributed objects (GDO) A data structure that is shared by all of the virtual processors in the Teradata Database configuration.

122

Teradata Index Wizard User Guide

Glossary

graphical user interface (GUI) The use of pictures rather than just words to represent the input and output of a program. A program with a GUI runs under a Windows operating system. The GUI displays certain icons, buttons, dialog boxes in its windows on the screen and the user controls it by moving a pointer on the screen (typically controlled by a mouse) and selecting certain objects by pressing buttons on the mouse. This contrasts with a command line interface where communication is by exchange of strings of text.

H
hash-ordered secondary index a secondary index whose rows are ordered by hash.

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. index analysis The process Teradata Index Wizard uses analyze a set SQL statements to find indexes to recommend. interface processor (IFP) Used to manage the dialog between the Teradata Database and the host. Its components consist of session control, client interface, the parser, the dispatcher, and the BYNET. One type of IFP is a communications processor (COP). A COP contains a gateway process for communicating with workstations via a network. internet protocol (IP) Data transmission standard; the standard that controls the routing and structure of data transmitted over the Internet.

J
join A select operation that combines information from two or more tables to produce a result.

K
kilobyte (KB) 1000 bytes.

L
log A record of events. A file that records events. Many programs produce log files. Often you will look at a log file to determine what is happening when problems occur. Log files have the extension .log.

M
macro A set of Teradata SQL statements stored by the Teradata Database and executed by a single EXECUTE statement. Each macro execution is implicitly treated as a transaction.

Teradata Index Wizard User Guide

123

Glossary

N
name A word supplied by the user that refers to an object, such as a column, database, macro, table, user, or view. non unique secondary index One of two types of secondary indexes. A secondary index may be specified at table creation or at any time during the life of the table. It may consist of up to 16 columns. To get the benefit of the index, the query has to specify a value for all columns in the secondary index. A non unique secondary index is usually specified in order to prevent full-table scans. null The absence of a value for a field.

O
object In object-oriented programming, a unique instance of a data structure defined according to the template provided by its class. Each object has its own values for the variables belonging to its class and can respond to the messages, or methods, defined by its class. object definition Shows the details of the structure and instances of the objects used by a given query. Object definitions are used to create tables, views, macros, triggers, join indexes, and stored procedures in a database. open database connectivity (ODBC) Under ODBC, drivers are used to connect applications with databases. The ODBC driver processes ODBC calls from an application, but passes SQL requests to the Teradata Database for processing. See Connecting Through ODBC on page 18 for more information.

P
parameter A variable name in a macro for which an argument value is substituted when the macro is executed. parser A program executing in a parsing engine that translates Teradata SQL statements entered by a user into the steps that accomplish the users intensions. parsing engine (PE) An instance (virtual processor) of the database management session control, parsing, and dispatching processes and their data context (caches). 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). See Selecting SQL Statements from the QCD on page 34 for more information.
124 Teradata Index Wizard User Guide

Glossary

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 (RAS) 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. row The fields that represent one entry under each column in a table. The row is the smallest unit of information operated on by data manipulation statements.

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. simple join index The primary function of a simple join index is to provide the Optimizer with a cost-effective means for satisfying any query that specifies a frequently performed join operation. The simple join index permits you to define a permanent prejoin table without violating the normalization of the database schema. 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 procedures Combinations of procedural and non-procedural statements run using a single call statement. structured query language (SQL) 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 system A Teradata Database from which you export Optimizer-specific information for modeling on a second, test system. 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

Teradata Index Wizard User Guide

125

Glossary

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. Teradata Director Program Identifier (TDPID) The name of the Teradata Database being monitored. Also used to establish a preprocessor connection to the Teradata Database. Teradata DQM Teradata SET Acronym for Teradata Dynamic Query Manager Acronym for Teradata System Emulation Tool.

Teradata Warehouse A Teradata Warehouse provides information that enables decisionmakers within an organization to manage customer relationships efficiently. It is about integrating advanced decision support with day-to-day, even minute-to-minute decision making that increases quality which encourages customer loyalty and thus secures an organization's bottom line. 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. TIWIZ Acronym for Teradata Index Wizard

trigger One or more Teradata SQL statements associated with a table and executed when specified conditions are met.

U
Unicode, UTF-8, and UTF-16 character sets UTF-8 and UTF-16 are two of the standard ways of encoding Unicode character data. Teradata Database V2R5.1 and later support UTF8 and UTF16 client character sets. The UTF8 client character set supports UTF-8 encoding. Currently, the Teradata Database supports UTF-8 characters that can consist of from one to three bytes. The UTF16 client character set supports UTF-16 encoding. Currently, the Teradata Database supports the Unicode 2.1 standard, where each defined character requires exactly 16 bits. There are restrictions imposed by the Teradata Database on using the UTF8 and UTF16 character sets. For details, see International Character Set Support. unique secondary index One of two types of secondary indexes. A secondary index may be specified at table creation or at any time during the life of the table. It may consist of up to 16 columns. To get the benefit of the index, the query has to specify a value for all columns in the secondary index. A unique secondary index has two purposes: It can speed up access to a row which otherwise might require a full table scan without having to reply on the primary index, and it can be used to enforce uniqueness of a column or set of columns. user A database associated with a person who uses the Teradata Database. The database stores the persons private information and accesses other Teradata Databases.

V
value ordered secondary index A non-unique secondary index can be value ordered which means the non unique secondary index can be sorted on the key values themselves rather than

126

Teradata Index Wizard User Guide

Glossary

on the corresponding hash codes. This is useful for range queries where only a portion of the index subtable will be accessed. With a value-ordered non unique secondary index, only those blocks in the non unique secondary index subtable that are within the range are scanned. It must be a number value, up to 4 bytes, versus a longer character column. DATE is the most commonly used data type. The actual data value is stored as part of the non unique secondary index structure. view An alternate way of organizing and presenting information in the Teradata Database. A view, like a table, has rows and columns. However, the rows and columns of a view are not directly stored by the Teradata Database. They are derived from the rows and columns of tables (or other views) whenever the view is referenced.

W
Windows call-level interface (WinCLI) A call-level interface designed for a Windows platform. See Connecting Through WinCLI on page 19 for more information. workload A workload is a set of SQL statements executed against a database. A single SQL statement is also a valid workload.

Teradata Index Wizard User Guide

127

Glossary

128

Teradata Index Wizard User Guide

Index

A
About Teradata Index Wizard dialog box 14 acronyms 121 Add QCD Statements dialog box 48 Add System Recommendations button 65 advanced index parameters 55 Analysis menu See menus Analysis Options dialog box 63, 66 analysis reports overview 23 viewing reports 77 Analysis Results dialog box 65, 70, 71 ASCII 20

B
bar graphs 109 blocks distribution graph 113

C
capturing data demographics 104 logged on user 104 CD-ROM images vi Change Graph Settings dialog box 110 change rate threshold 57 changing bar graphs 110 font 9 graphic perspective 110 logon method 18 character sets command line syntax 115 setting command line interface 116 Windows interface 20 UTF-16 126 UTF-8 126 checkpoint frequency 58, 60, 116 Collect Statistics statements, handling 65 command line defining a workload 117 help 115 inputs to Index Wizard 117 interface 115 interface syntax 115

log on information 116 opening the GUI 115 options 116 specifying output file name 118 Connect to Teradata Database dialog box 19 connecting to the Teradata Database ODBC 18 WinCLI 19 connections errors database name error 20 password error 20 user name error 20 connectivity type, setting 104 copyright information 15 cost profiles handling errors 43 import options 43 Create from Existing Workload dialog box 44 create new data source 18 Create New Data Source dialog box 19 creating workloads 27 creation scheduled recommendation 96 Creation menu See menus

D
data demographics blocks distribution 113 changing to bar or line graphs 109 disk space utilization graph 111 graph types 110, 111 menu options 108 overview 107 row count/avg. row size 112 spool space utilization 112 statistics details 113 Data Demographics window controls 109 opening 107 database name error 20 database query log See DBQL DBQL defining a workload 27 search criteria 28 using DBQL statements 27 default directory, setting 104

Teradata Index Wizard User Guide

129

Index

Define Workload from DBQL Statements dialog box 28 Define Workload using Statements dialog box 33 Define Workloads from QCD Statements dialog box 35 defining a data source 18 defining a workload from a existing workload 44, 46 from the QCD 34 importing a workload 37 introduction 5 quick start 20 using an SQL statement 32 using DBQL statements 27 Disk Object Global Use Count Report column descriptions 82 Disk Space Analysis Report column descriptions 84 opening 84 disk space utilization button descriptions 111 graph 111 displaying statement text 52 documentation Messages (errors) vi ODBC Driver for Teradata vi on the Web vi online Help 14 SQL Reference, Data Definition Statements vi Teradata Index Wizard vii Teradata Query Scheduler vi Teradata SQL Assistant vi Teradata Statistics Wizard vi Teradata System Emulation Tool vi Teradata Visual Explain vi duplicate IDs, avoiding 27

The QCD mentioned does not exist 119 errors documentation vi schedule recommendation errors, correcting 99 See connection errors execute immediately option 95 Execute Recommendations dialog box 25, 95 execute SQL 101 Execute SQL - Query window 101 Execute SQL window 103 executing recommendations immediately 95 quick start 25 Execution Results window 96 Execution Time Frames dialog box 99 Existing Indexes Report opening 78 option descriptions 78

F
File menu See menus filters 28

G
general information about Teradata vii general tab 104 graph preferences 111 graphs 109, 113

H
Help menu See menus help, online 6, 14

E
End Date field 29 End Time field 29 Error Handling dialog box 41 error messages display object exists 42 documentation vi duplicate primary key 42 error in allocating memory 119 error in creating recommendations file 119 error in loading recommendations from file 119 error in opening registry 119 error in password 119 error in Teradata Database name 119 error in user name 119 SQL statement failed 42 The control files required for importing... 119

I
implementing a recommended index 25 Import File dialog box 38 importing a workload brief description 5 how to 37 options 43 setting the TLE 39 index analysis analysis process 72, 73 brief description 5 inputs 104 new analysis 53 overview 53 quick start 22 restart analysis 60 types of 5 what-if analysis 61

130

Teradata Index Wizard User Guide

Index

what-if analysis results 70 Index Analysis dialog box 22, 53, 54 Index Analysis Parameters dialog box 55, 105 Index Analysis Summary window 54, 60, 73 Index Maintenance Cost Report 86 index maintenance mode 57, 118 Index Recommendation Report 83 index recommendations applying immediately 95 Index Types dialog box 59 index types, setting 58 Index Validation dialog box 90 index validation See validation Index Validation window 91 Index Wizard See Teradata Index Wizard index/statistics DDL text, viewing 66 Information Products Publishing Library vii

indexes per table 57 wait time 98 menus Analysis menu 10 Creation menu 12 File menu 8 Help menu 14 Reports menu 11 Tool menu 12 Validation menu 12 View menu 8 Windows menu 13 Workload menu 9 Messages, see documentation vi

O
Object Global Use Count Report opening 82 ODBC connecting to the Teradata Database 18 defining a data source 19 documentation vi driver setup 19 ODBC Data Source Administrator 18 toolbar button 13 ODBC Data Source Administrator 19 ODBC Data Source Administrator dialog box 19 ODBC Driver Setup for Teradata Database dialog box 19 opening parameters from file 115 ordering publications vii

J
join indexes aggregate join index defined 121 specifying in what-if analysis 64 columns, setting number of 57 global join index defined 122 specifying in what-if analysis 64 simple join index defined 125 specifying in what-if analysis 64 viewing the number of 86

K
KANJISIS_OS 20 keeping existing indexes 56

P
parameters opening from file 115 password error 20 Performance Improvement Chart 71 Please Select a Data Source dialog box 18 Preferences dialog box 103 Connectivity tab 18, 104 General tab 104 Path tab 104 product version numbers iii, 14 product-related information vi publications related to this release vi

L
line graphs 109 loading recommendations from a file 92 from QCD 90 log on methods connecting through ODBC 18 connecting through WinCLI 19 logged on user, setting preferences 104

Q
QCD Access option 103 loading recommendations from 90 selecting SQL statements from 10, 34 statements 5 query capture database See QCD

M
maintenance costs, specifying 57 maximum candidate indexes 56 columns per secondary index 57

Teradata Index Wizard User Guide

131

Index

query capture facility See QCF Query Cost Analysis Report opening 83 option descriptions 83

R
recommendations executing a recommendation immediately 95 executing, quick start 25 loading recommendations from file 92 loading recommendations from QCD 90 scheduling a recommendation 96 validating 24 Recommendations from QCD dialog box 24, 90 release definition vi reports Disk Space Analysis 84 Existing Indexes 78 Index Maintenance Cost 86 Index Recommendations 83 Object Global Use Count 82 Query Cost Analysis 83 Summary 85 Table Scan 80 Table Usage 79 Update Frequency 79 Workload Analysis 81 Workload Statements 62 Reports menu See menus Reports tab 62 Reports toolbar location 77 restart an analysis 60 Restart Analysis dialog box 60 Result Rows field 29 row count/avg. row size 113 row count/avg. row size graph 112

Shortcut menus 16 single join index recommendations index types, setting 58 join index, setting number of columns 57 statistics collection, setting sample size 104 spool space utilization button descriptions 112 graph 112 SQL Assistant See Teradata SQL Assistant SQL Reference, Data Definition Statements documentation vi SQL statements defining a workload 32 errors defining a workload using SQL statements 36 start date 98 time 98 Start Date field 28 Start Time field 29 Statement Text dialog box 29 statement text, viewing 66 statistics collection, selecting sample size 104 statistics details button descriptions 113 graph 113 Statistics Information dialog box 65 Statistics Wizard See Teradata Statistics Wizard status bar 15 Step Count field 29 Summary Report opening 85 option descriptions 85 System Recommendations tab 62

T
Table Scan Report opening 80 option descriptions 80 Table Usage Report column descriptions 79 opening 79 technical support vii Teradata Database Connect dialog box 18 Teradata Index Wizard documentation vii error messages 119 quick start 17 Teradata Query Scheduler correcting errors 99 documentation vi error explanations and remedies 99 scheduling recommendations 96 Teradata SQL Assistant

S
sample size, selecting 104 Schedule Recommendations dialog box 25, 98 scheduled recommendation 96 scheduling options 98 Select a File for Validation dialog box 92 Select a File to Import Workload dialog box 37 Select Recommendations dialog box 97 Select Users and Accounts dialog box 30 Select Workload dialog box 61, 92 session character sets See character sets Set Costs tab 66 Set RAS tab 67 Set Statistics Samples tab 68 Set Target Level Emulation dialog box 40

132

Teradata Index Wizard User Guide

Index

documentation vi opening using menu option 103 preferences, setting 104 toolbar button 13 Teradata Statistics Wizard documentation vi opening using menu option 103 toolbar button 13 Teradata System Emulation Tool documentation vi opening using menu option 103 toolbar button 13 Teradata Visual Explain documentation vi opening using menu option 103 toolbar button 13 viewing data using 25 Time Frame Properties dialog box 99 tools index analysis inputs 104 other Teradata client tools 103 preferences 103 Tools menu See menus

Validation menu See menus Validation Results Report 25 version numbers Teradata Database iii Teradata Index Wizard 14 Teradata Tools and Utilities iii View Details dialog box 62, 66 View menu See menus View Reports dialog box 74, 87 View Statement dialog box 52, 66, 74 View Workload Details dialog box 51 viewing analysis reports 74, 87 data using Visual Explain 25 reports 23 statement text for index and statistics 66 statement text for workloads 52 Visual Explain See Teradata Visual Explain

W
Warning dialog box 36 what-if analysis 61 advanced button 66 analysis summary 73 index types, specifying 64 statistics information window 68 Teradata Visual Explain 72 view details button 65 what-if analysis results 70 What-If Analysis Add Index dialog box 63 What-If Analysis dialog box 62 WinCLI connecting to the Teradata Database 19 Windows menu See menus workload cleanup 50 creating from existing workload 44 from the QCD 34 using DBQL statements 27 using SQL statement text 32 importing a workload 37 quick start 20 status 51 summary 52 updating from existing workload 46 Workload Analysis Report opening 81 option descriptions 81 Workload Clean Up dialog box 50 Workload Definition Summary window 32, 34, 36 Workload menu See menus workload reports, viewing 77

U
Unicode 126 Update Existing Workload dialog box 47 Update Frequency Report opening 79 option descriptions 79 updating an existing workload how to 46 statement options 48 Use SQL Assistant instead of Execute SQL Query window check box 104 user name error 20 UTF-16 character sets 20, 126 UTF-8 character sets 20, 126

V
validation analysis 25 brief description 6 executing recommendations 25 loading recommendation from file 92 loading recommendations from QCD 90 overview 89 production system 89 results 92 results report 25 test system 89 validating recommendations 24 validation process 89

Teradata Index Wizard User Guide

133

Index

Workload Statements Report opening 62

134

Teradata Index Wizard User Guide

You might also like