Using AS/400 Database Monitor and Visual Explain
|
|
|
- Gary Atkinson
- 10 years ago
- Views:
Transcription
1 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries Understand the basics of how to identify and tune the performance of SQL Learn about the new graphical Operations Navigator Visual Explain tool See how Database Monitor can assist in SQL performance Redpaper Hernando Bedoya Greg Leibfried Daniel Lema Richard Odell Rick Peterson Dale Weber ibm.com/redbooks
2
3 International Technical Support Organization Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries January 2001
4 Take Note! Before using this information and the product it supports, be sure to read the general information in Appendix A, Special notices on page 39. First Edition (January 2001) This document was created or updated on January 9, Comments may be addressed to: IBM Corporation, International Technical Support Organization Dept. JLU Building Highway 52N Rochester, Minnesota When you send information to IBM, you grant IBM a non-exclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. Copyright International Business Machines Corporation 2000, All rights reserved. Note to U.S Government Users - Documentation related to restricted rights - Use, duplication or disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corp.
5 Contents Preface...v The team that wrote this redpaper......v Commentswelcome...v What is the Database Monitor for AS/400 tool?...1 CollectingDBMonitordata...1 ImportinganSQLPerformanceMonitor...3 SpecialconsiderationoncollectingDBMonitordata...3 DBMonitorrecordtypes...3 GlobalDBMonitordatafields...4 HowthequerydataisorganizedinDBMonitor...6 LinkingqueryinstancesinMonitordata...7 Reported DB Monitor record types Record - SQL statement summary Record - Arrival sequence (table scan) Record - Using existing index Record - Index create Record - Query sort Record - Temporary file Record - Access plan rebuild Record - Summary optimization Record - Host variable and ODP implementation Record - Bitmap created Record - Bitmap merge Record - Temporal hash table created Record - Grouping AnalyzingSQLstatementsinvolvingJOINs Record - Generic query information OtherDBMonitorrecords...21 Operations Navigator Visual Explain...23 UsingVisualExplain...23 UsingVisualExplaininteractively...23 UsingVisualExplainoverDBMonitorcollecteddata...24 VisualExplainresults...25 Database performance analysis...27 Database performance problems that are not easily avoidable Problems that are generally avoidable...28 Creating indexes For faster analysis AlteringinsertwithsubselectdatainaMonitorfile...30 DB Monitor query examples 1 through Example1:Identifythespecificjob(s)toanalyze...30 Example 2: Which type of SQL operations account for the most run time Example 3: Which SQL operations account for the most run time (list by text). 31 Example 4: Which queries account for the most run time (list by QQUCNT).. 31 Example 5: Which queries account for the most run time Example 6: How do I determine how an individual query was run Example 7: Which queries are significantly affected by full opens Example 8: List all queries (sorted by text) that are doing full opens...33 Copyright IBM Corp. 2000, 2001 iii
6 Example 9: List all queries with full opens that contain a temporary index build 34 Example10:Whichindexbuildsaredonemostoften...34 Example 11: Which full opens are not avoidable due to temporary table results35 Example12:Whichqueriesinvolveanarrivalsequence...35 Example 13: Which queries involve the use of a query sort End user query tools...36 Summary...36 Additional information and author contacts...37 Appendix A. Special notices...39 iv Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
7 Preface The purpose of this redpaper is to help you to understand the basics of identifying and tuning the performance of Structured Query Language (SQL) statements using DB2 Universal Database for AS/400 (DB2 UDB for AS/400). DB2 UDB for AS/400 provides a comprehensive set of tools for helping technical analysts tune SQL queries. Database Monitor for AS/400 (DB Monitor) is part of the set of tools OS/400 provides for assisting in SQL performance analysis since Version 3 Release 6. It is used to analyze database performance problems after SQL requests have been run. Operations Navigator Visual Explain is a new tool that shows the internal steps that DB2 UDB for AS/400 performs in response to an SQL query. Because of its graphical nature, it gives a new perspective on SQL query performance analysis. This redpaper presents a series of tips and techniques based on DB Monitor and Visual Explain that may be used to demonstrate how to get the most out of both DB2 UDB for AS/400 and query optimizer when using SQL. You should be aware that usage of DB Monitor is technically demanding. IBM offers Learning Services courses on database tools and analysis to help you. The team that wrote this redpaper This redpaper was originally written by a team of specialists from the IBM Rochester Lab: Greg Leibfried Richard Odell Rick Peterson Dale Weber This redpaper was recently updated by the International Technical Support Organization Rochester Center: Hernando Bedoya ITSO Rochester Daniel Lema IBM Colombia Comments welcome Your comments are important to us! We want our redpapers to be as helpful as possible. Please send us your comments about this redpaper or other Redbooks in one of the following ways: Use the online evaluation form found at ibm.com/redbooks Send your comments in an Internet note to [email protected] Copyright IBM Corp. 2000, 2001 v
8 vi Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
9 What is the Database Monitor for AS/400 tool? The Database Monitor for AS/400 tool (DB Monitor) is an AS/400-based tool used to gather performance related statistics for SQL queries run on AS/400. Data collected by the DB Monitor is stored in an AS/400 database file where it can be queried to help identify and tune performance problem areas. Results from the DB Monitor can be useful for batch jobs and online transactions. Also, the results can be used to look at SQL queries from a global system level for a specific job or a specific query. DB Monitor data is most useful if the user has a basic knowledge of AS/400 query optimization techniques. Collecting DB Monitor data Use Operations Navigator Database functions to start, pause, analyze, and stop DB Monitor. Alternatively you can use the STRDBMON command or STRPFRMON with STRDBMON(*YES) to start the DB Monitor. The DB Monitor will collect information on previously started jobs or new jobs started after the monitor collection has begun. Because of the volume of data collected, try to gather data for a specific job only. This makes analysis easier and keeps the DB Monitor file smaller. If this is not possible, collect data on all of the jobs, and use queries to select the specific jobs of interest. It should also be noted that when the DB Monitor is gathering data, a significant amount of CPU utilization (20 to 30 percent) and disk usage may be temporarily required. Starting DB Monitor Using Operations Navigator database functions, you have two options for DB Monitor: summary and detailed. The summary provides basic information over table scan, data sorts, host variable use, optimizer time-outs, access paths considered, indexes used, indexes created, subselect processing, and temporary file use. With the detailed DB Monitor, you have detailed information about the query and its access path, which we describe in this redpaper. Starting a summary SQL Performance Monitor starts a memory resident database monitor which is a lighter workload for the system. A detailed SQL Performance Monitor causes a heavier workload, equivalent to that of the STRDBMON... TYPE(*DETAILED). There is no equivalent to STRDBMON... TYPE(*SUMMARY) in Operations Navigator. To start DB Monitor with Operations Navigator, right-click SQL Performance Monitors and, depending upon your needs, select New->Summary or New->Detailed (see Figure 1 on page 2). This takes you to the New SQL Performance Monitor dialog box. On the General tab, a name and library is requested for storing the collected data. In the Monitored Jobs, tab you can select the jobs that you are interested in monitoring. Selecting all jobs may cause a significant overhead on the system, particularly if it is a detailed data collection. Copyright IBM Corp. 2000,
10 Figure 1. Starting a new DB Monitor Pausing, Continuing, Ending, and Deleting a DB Monitor Right-click a specific SQL Performance Monitor on Operations Navigator to obtain a menu like the one shown in Figure 2. You can pause or end an SQL Performance Monitor. When you end an SQL Performance Monitor, you cannot start it again. You can continue with an SQL Performance Monitor that was previously paused. Figure 2. SQL Performance Monitor pop-up menu If you no longer need an SQL Performance Monitor and the data associated with it, you can delete it. SQL Performance Monitor data table Selecting Properties from the menu in Figure 2 displays a properties window with three tabs. Under Saved Data tab, you can find the library and file name for the DB Monitor captured data. You will need this to create your own queries over DB Monitor tables. 2 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
11 Importing an SQL Performance Monitor You can import data collected from STRDBMON into SQL Performance Monitor using Operations Navigator. You can also import data collected on other systems. To do this, right-click SQL Performance Monitors icon (in Operations Navigator), select the Import option. Then the Import SQL Performance Monitor Files dialog window appears. Fill in the required fields: Monitor Name, File and Library where the monitor resides. You can take a summary DB Monitor from the STRDBMON interactive command and import it into an Operations Navigator Detailed SQL Performance Monitor. It will import all of the necessary information, even for Visual Explain, except for row access information (useful only for analyzing non-sql data access). Special consideration on collecting DB Monitor data Optimization records/data will not appear for queries that are already in reusable ODP mode when the monitor is started. To ensure the capture of this data for a batch job, start the DB Monitor before the job starts and collect it over the entire length of the job (or as much as needed). For online transactions, start the monitor before connecting to the QZDASOINIT server job to ensure optimization data is collected. The STRDBMON JOB(*ALL) command is needed in both of these cases. If optimization data was not collected for a given query, run the query using Operations Navigator Run SQL Script or Start SQL (STRSQL) command or other tools and collect debug messages or DB Monitor data. Obtain the query text from the DB Monitor data or from the step mode trace. If the DB Monitor is ended while the query is in progress, optimization data is collected but other data for that query (SQL text, etc.) is not. DB Monitor record types DB Monitor collects different data and stores records in a single table in the order of occurrence. Each record contained in the DB Monitor table contains a record type field. The DB Monitor uses the QQRID field to describe the type of information gathered in the particular record. The DB Monitor record types most often used for performance analysis are listed here: Record types most often used (QQRID value) 1000 SQL summary record 3000 Arrival sequence 3001 Using existing index 3002 Index created 3003 Query sort 3004 Temporary results file 3006 Access plan rebuilt 3007 Summary optimization data (also known as index optimization data) 3010 Host variable and ODP implementation 3021 Bitmap created 3022 Bitmap merge 3023 Temporal hash table created 3026 Union merge 3027 Subquery merge 3
12 3028 Grouping 3029 Index ordering DB Monitor record types: Other record types 3005 Table locked 3008 Subquery processing 3014 Generic query information 3018 STRDBMON and ENDDBMON data 3019 Records retrieved detail (only with *DETAIL) 3025 DISTINCT processing 3030 Query step processing Record types 3000 to 3008, 3014, and 3021 to 3029 occur during a full open and can be referred to as optimization records. Optimization records are much like debug messages. These records are necessary to determine the access plan for any given query in the DB Monitor data. Global DB Monitor data fields The data fields that are common to all record types are: QQJOB Job name QQUSER Job user name QQJNUM Job number: The job number is very useful when multiple jobs are collected in one DB Monitor file. QQJFLD Join field: Contains information that uniquely identifies a job and includes job name, job user name, and job number. QQTIME Time that the record was created: The time record can be useful when trying to find out what queries were running in a given time period. QQUCNT Unique number given for each query within a job. QQUCNT links together all DB monitor records associated with all instances of a unique query within a job. The QQUCNT value assigned at full open time stays constant for all subsequent instances of that query. Non-ODP SQL operations (prepare, describe, commit) have QQUCNT = 0 and thus cannot be linked to a query. But the QQ1000 field in the prepare or describe 1000 record will contain the prepared SQL text. QQUCNT is not set for optimization records. QQI5 Refresh counter: This record specifies the instance number for a unique query. It is used in conjunction with the QQUCNT value to look at a specific instance of a query and is only valid on 3010 and 1000 SQL summary records. QQRID Non-ODP 1000 records (commit, prepare, etc.) have QQI5 = 0. Record Identifier: Identifies the type of record. 4 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
13 Tip If you are going to use the Operations Navigator Run SQL Script facility, change the ODBC Setup to force translation for CCSID 65535, because the QQJFLD has been defined as FOR BIT DATA. Otherwise this field will be shown in hexadecimal. Reset to default to use Visual Explain; otherwise it will fail. Figure 3 shows an example of the fields in the DB Monitor table. Figure 3. Global DB Monitor data example The combination of QQJFLD and QQUCNT provides a powerful tool to join different optimization records for the same SQL statement. We exploit this extensively in this redpaper. Other fields common to many records are those that identify tables or indexes used: QQTLN Library of the table queried. QQTFN Name of the table queried. QQPTLN Base library. QQPTFN Base table. QQILNM Library of the index used. QQIFNM Name of the index used: *N when it is a temporary index. Beginning with V4R5, new fields were added to include long names for the resources used: QVQTBL Queried table long name. QVQLIB Queried library long name. QVPTBL Base table long name. 5
14 QVPLIB QVINAM QVILIB Base table library long name. Index used long name. Index library long name. How the query data is organized in DB Monitor The first occurrence of a unique query within the job always results in full open. A unique query is one that requires a new ODP. SQL has determined that there is no existing ODP that can be used. The presence of optimization records indicates a full open for an open, select into, update, delete, or insert operation. Optimization records are immediately followed by SQL summary records (QQRID=1000) for that operation. Subsequent occurrences of this query within same job either run in reusable ODP (Figure 4) or non-reusable ODP (Figure 5) mode. Non-reusable mode indicated by presence of optimization records each time a particular query is run (full open). Reusable ODP mode is indicated by 3010 and 1000 records each time the given query is run (no optimization records or full open). SELECT qqrid AS "QQRID Record Type",qqucnt AS "QQUCNT Unique Counter",qqi5 AS "QQI5 Refresh Counter",qqjfld AS "QQJFLD Join Field",qqc21 AS "QQC21",qq1000 AS "QQ1000 Text",qqtime FROM team11.reusablodp ORDER BY qqtime OPTIMIZE FOR ALL ROWS; First execution of the sentence. Notice that the optimization records are present. In the subsequent executions, there are no optimization records. Figure 4. Example of a reusable ODP SQL statement 6 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
15 First execution of a non-reusable query. Notice that in the QVC14 field for the 1000 record (ODP Implementation) for the open (QQC21 = OP) operation has a value of N, meaning that this ODP is non-reusable. In the second execution of the same SQL statement, it registers all optimization records. Figure 5. Example of a non-reusable ODP SQL statement Linking query instances in Monitor data The data in the DB Monitor file is arranged chronologically. This can make it difficult to find all instances of a unique query. Use the QQJFLD, QQUCNT, and QQI5 fields to view specific query instances. Be aware of the following situations: QQUCNT is assigned during a full open and will be constant for all subsequent instances of a query. Non-ODP SQL operations (prepare, describe, commit) have QQUCNT = 0 and, therefore, cannot be linked to a query. If this is the case, you can use QQ1000 field that in the prepare or describe operation contains the prepared SQL text. Non-ODP 1000 records (commit, prepare, etc.) have QQI5 = 0. 7
16 A full open occurs when the SQL operation is either an update, insert, delete, or open and the QQI5 record is 0. See Figure 4 and Figure 5 on page 7 for examples of QQJFLD/QQUCNT/QQI5 in reusable and non reusable ODPs. Reported DB Monitor record types Each of the DB Monitor record types provide a specific type of information gathered by the DB Monitor as it collects data during SQL performance runs. You can build your own queries or use the predefined queries provided by Operations Navigator. To use the predefined Operations Navigator queries, select Database -> SQL Performance Monitor from the left window. A list of Performance Monitor data collections appears in the right window. Right-click a collection and select analyze results (see Figure 2). You will be able to select, modify, and execute summary, detailed and extended detailed results. The summary reports give you information about the entire data collection and will help you find exceptions. For example, you may list jobs ordered by descending total run time in the Job Summary report. You can also alter the predefined query by clicking the Modify Selected Queries button (see Figure 6). Tip Use predefined Summary Results over a summary DB Monitor to identify the most resource hungry and time-consuming jobs as your starting point for analysis. You can modify predefined queries using the Modify Selected Queries button. Figure 6. Predefined DB Monitor reports in Operations Navigator 8 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
17 Once you have detected jobs of interest, collect detailed DB Monitor data for those jobs. Use detailed and extended detailed predefined reports for further analysis. The predefined reports are SQL queries built on the DB Monitor table, usually joining different types of records. The basic record used for each report is shown in Figure 7. QQRID /1/ QQRID , , Figure 7. Detailed, Extended Detailed Results and their main source of information 1000 Record - SQL statement summary The 1000 record is the basic record type for any SQL query analysis. One record exists for each SQL operation (open, update, close, commit, etc.). The most commonly used fields QQ1000 Prepared text of SQL statement Literals in the original SQL text may be replaced by parameter markers in prepared text if SQL was able to convert them during prepare (desired). For the original SQL text, use literal values from the matching 3010 record in the place of parameter markers or obtain the text from the step mode file using the QQSTIM timestamp from this record. QQC21 QQI2 QQI3 QQI5 QQI4 Type of SQL operation (OP, FE, CL, UP, IN, DL,...): 'MT' in this field indicates a continuation record for SQL statements that exceed 1000 characters. FE (fetch) records are summary records, one per open. Number of rows updated, inserted, or deleted Number of rows fetched (only on FE records): The QQI3 field shows the actual number of rows fetched, not the number of fetch attempts. Refresh counter (use in conjuction with QQUCNT). A full open occurs when QQI5=0 and QQC21 is UP, DL, IN or OP. Elapsed time for this operation in milliseconds. 9
18 QQI6 QQSTIM QQETIM Elapsed time for this operation in microseconds. Timestamp for start of SQL operation (microsecond granularity). Timestamp for end of SQL operation (microsecond granularity). QQETIM-QQSTIM shows the elapsed time for an operation in seconds down to microsecond granularity. For FE records, use QQI6 or QQI4; QQETIM-QQSTIM is not valid. The other commonly used fields QQC22 Access plan rebuild reason code. QQC103 and QQC104 Package name and package library name. QQC181 Cursor name. QQC16 Data conversion reason code. QVC11 ALWCPYDTA setting (Yes, No, Optimize). QVC14 ODP implementation (R: Reusable N:Nonreusable). QVC41 Commitment control level. In Figure 8, you can find an example of some of the fields commonly used on type 1000 records. 10 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
19 SELECT qqucnt AS "QQUCNT Unique Counter",qqc21 AS "QQC21 Statement Operation",qqetim - qqstim AS "Elapsed Time",qq1000 AS "QQ1000 Text",qqi3 AS "QQI3 Fetched Rows",qqc16 AS "QQC16 Data Conv.",qvc11 AS "QVC11 ALWCPYDTA",QVC41 AS "QVC41 Cmt Control Lvl",rrn(a) FROM qzg a WHERE qqrid = 1000 ORDER BY rrn(a) OPTIMIZE FOR ALL ROWS; Note the Elapsed Time column. This operation took 3.21 sec. opening and 0.07 sec. fetching two rows, and required a data conversion RC = 4, which corresponds to a CHAR to VARCHAR conversion. This SQL statement is too large to be contained in only one 1000 record. Figure 8. Example of type 1000 records with a user-defined query 3000 Record - Arrival sequence (table scan) The 3000 record points out queries in which the entire table is scanned without using an index. A table scan is generally acceptable in cases where a large portion of the file will be selected or the selected file contains a very small number of records. Otherwise, using an index usually provides better performance. An insert with a subselect will have a 3000 record for the file being inserted into, but this is not a performance problem on its own. This does not indicate that the ODP is non-reusable. The record data may contain useful index advisor data. The most commonly used fields QQTLN, QQTFN, QQPTLN, QQPTFN, QVQTBL, QVQLIB, QVPTBL, and QVPLIB describe the scanned table as documented in Global DB Monitor data fields on page 4. QQTOTR Number of rows in table. Use QQTOTR to determine if the table scan was done for a significant number of rows. QQRCOD Reason code; why the arrival sequence was chosen. QQIDXA Index advised (Y or N). If the QQIDXA field is 'N', QQI2 and QQIDXD will not contain data. 11
20 QQI2 QQIDXD Number of primary (key positioning) keys in the QQIDXD field. Suggested keys for index (selection only). The QQIDXD field can contain both primary and secondary keys. Starting from the left, QQI2 tells how many keys are considered primary. Other keys are considered less selective (secondary). It is important to include the most selective keys since the database optimizer is estimating. Even if an index is not advised, it is still best to determine if a good index can be created for this table by looking at the selection in the SQL text. This is especially important if the cumulative time for this query is significant. This can be measured by the total of QQI6 or QQI4 values for the 1000 FE records for this query Record - Using existing index The 3001 record shows the index that will be used to access the file and why it was chosen. If the index was chosen for join, additional information is given to help determine how the file fits in the join. The order of the 3001 records indicates the join order chosen by the optimizer. The most commonly used fields QQTLN, QQTFN, QQPTLN, QQPTFN, QQILNM, QQIFNM, QVQTBL, QVQLIB, QVPTBL, QVPLIB, QVINAM, and QVILIB describe the table and index used as documented in Global DB Monitor data fields on page 4. QQILNM and QQIFNM contain *N if the index was a temporary index. QQRCOD Reason the index was selected I1 Selection only I2 Ordering or grouping I3 Selection and ordering/grouping I4 Nested loop join I5 Record selection using bitmap Bitmap selection has a DB Monitor record sequence of 3007, 3000, and QQTOTR Number of rows in the table. QQIDXA Index advised (Y or N). QQI2 Number of primary (key positioning) keys in QQIDXD field. QQIDXD Recommended primary and secondary keys for index on this table. Important The keys listed can possibly be better than those in the selected index, but not always. Generally, the selected index will be fairly good, or the database optimizer has chosen to build a temporary index that fits well. These keys are for selection only and the user also needs to consider join/order by/group by clause criteria. Figure 12 on page 20 shows some examples of 3001 records. 12 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
21 3002 Record - Index create The 3002 record shows instances in which the database optimizer decided that existing indexes are too costly or do not have the right key order for join, group by, or order by clauses. Refer to the 3007 record for this file to see why existing indexes were not selected. The newly created indexes are temporary and are not usable by other ODPs. A temporary index build does not mean that the ODP is non-reusable. The database optimizer tries to reuse the temporary index for each execution of the specific query but in some cases cannot. For example, if the selection built into the temporary index changes with each run of the query, the temporary index may not be reused. If the temporary index build is done during the full open for this query, but the query goes into reusable ODP mode, then the temporary index is reusable. If a particular query is run multiple times and a temporary index is built each time, a permanent index must be created to avoid the index build and to make the ODP reusable. Indexes are never built for selection alone; they always involve a join or a group by or order by clause. No name is given to the temporary index. *TEMP is used in subsequent monitor records. The most commonly used fields QQTLN, QQTFN, QQPTLN, QQPTFN, QQILNM, QQIFNM, QVQTBL, QVQLIB, QVPTBL, QVPLIB, QVINAM, and QVILIB describe the table and index used as documented in Global DB Monitor data fields on page 4. QQILNM and QQIFNM contains blanks if the index was built from a table. They will contain the library and index name used if an index from index build occurred. QQRCOD Reason for the index name build. I2 Ordering or grouping I3 Selection and ordering/grouping I4 Nested loop join I1 Listed in the DB Monitor guide, but will not appear for temporary index builds. QQTOTR Number of rows in table. QQRIDX Number of entries in temporary index. QQSTIM Timestamp for start of index build. QQETIM Timestamp for end of index build QQETIM-QQSTIM shows the elapsed time for the index build. Long running builds or builds that are repeated many times and result in a fair number of full opens are prime candidates for being replaced with permanent indexes. QQ1000 Contains join, order by or group by keys used in index build. This field indicates whether the key is ASC or DESC (this is important for permanent indexes). It does not include additional selection that may have been used to build the index. If *MAP is one of the keys listed, the index build cannot be avoided, but this does not necessarily mean that the ODP is non-reusable. 13
22 QQIDXA QQI2 QQIDXD If QQTOTR = QQRIDX, then the selection is probably not built in, and the permanent index can generally be built using only the keys from the QQ1000 field. If QQTOTR > QQRIDX, then the selection was built in. If so, it is necessary to use a combination of selection keys and the keys listed in the QQ1000 field to build a permanent index. It may be necessary to look in the query text for keys in ANDed equals predicates and other selective comparisons. If QQIDXA = Y, QQIDXD will contain good selection keys. However, it still may be necessary to look at the query text if there are problems getting the database optimizer to choose a created index. It is generally best to build a permanent index with good selection keys first, followed by join, order by, or group by keys. Index advised (Y or N). If 'N', QQI2 and QQIDXD will not contain data. Number of primary keys in QQIDXD. The QQI2 field contains the number of keys over which key positioning can be used. Suggested primary and secondary keys for index (selection only). The QQIDXD field can contain both primary and secondary keys. Starting from the left, QQI2 tells how many keys are considered primary. Other keys are considered less selective (secondary). This field will be blank if an existing index contains most or all of the recommended selection. If keys are listed, use the most selective ones combined with keys from the QQ1000 field. It is still important to include the most selective keys since the optimizer is estimating. Even if an index is not advised, it may still be best to try to create an index using the selection from the SQL statement, if it is a good selection. Remember that building a permanent index that the optimizer will use is an iterative process, but it often has significant payback. Note the following points in Figure 9: The most expensive temporary index was built over ITEM_FACT with key CUSTKEY ascending. Even if this index was not advised, it is possible to get a benefit in creating this index, depending on how frequently the index is created. In the data sampled here, we found some indexes created for join, recognized by the reason code (QQRCOD) of I4. Others were created for ordering or grouping (reason code I2). Indexes over CUST_DIM were advised. Row 9 shows an index from index. Note the presence of information in fields QQILNM and QQIFNM. Note also the value on QVC16 (Index from Index). Row 7 shows an index with built in selection. Row 9 shows an index with a mapped key. 14 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
23 SELECT qqptln as "QQPTLN Base Library",qqptfn as "QQPTFN Base Table",qqilnm as "QQILNM Lib for Idx Used",qqifnm as "QQIFNM Name for Idx Used",qqrcod as "QQRCOD Reason Code",qqtotr as "QQTOTR Rows in Table",qqridx as "QQRIDX Entries in Temp Idx",qqetim - qqstim as "Idx Build Time",qq1000 as "QQ1000 Index Created Key",qqidxa as "QQIDXA Index Advised",qqi2 as "QQI2 Nbr of Primary Key",qqidxd as "QQIDXD Index Advised Key",qvc16 FROM qzg WHERE qqrid = 3002 ORDER BY "Idx Build Time" desc; Figure 9. Type 3002 records - Index created 3003 Record - Query sort The 3003 record shows that the database optimizer has decided to put selected records into a temporary space and sort them. This is either cheaper than alternative indexed methods or it is forced to do so, for example: UNION or order by on fields from more than one file. Indexes can still be used to select or join records before the sort occurs. This does not indicate that the ODP is non-reusable. The 1000 SQL summary record for the open may have a high elapsed time (QQI6 or QQI4). Sort buffers are refilled and sorted at open time, even in reusable ODP mode. However, high elapsed times may indicate a large answer set. In this case, the sort will outperform index usage (this is the situation in most cases). If sort seems slow and using an index might be better, try to influence the optimizer away from the sort with better selection indexes. For example, if the answer set is small, but the optimizer does not have the right indexes available to 15
24 know that, creating these indexes can help. This is possible only if the optimizer is not forced to use the sort. The most commonly used fields QQSTIM Timestamp for start of refill and sort. QQETIM Timestamp for end of refill and sort QQRCOD Reason for choosing query sort. The QQRCOD field helps to determine whether a sort was required or if it was costed this way. Refer to the DB Monitor guide for the reason codes. QQRSS Number of rows in sort space. The QQRSS field can be used, along with reason code, to determine if the indexed approach is possible and possibly cheaper (for a small result set). Use the QQI3 value from the corresponding 1000 FE record for this open to determine how many rows were fetched from the sort space. If the QQRSS value is large, but the actual number of rows fetched is small, consider adding OPTIMIZE FORnROWStothe query to help the optimizer. Figure 10 contains an example of the predefined query for sort information. Figure 10. Sort information predefined report (some columns are shown as truncated) 3004 Record - Temporary file The 3004 record show that the database optimizer is forced to store intermediate results/rows in a temporary file due to the nature of the query. Examples are group by on fields from >1 file or materializing view results. The most commonly used fields QQSTIM Timestamp for start of fill temporary results table. QQETIM Timestamp for end of fill temporary results table. QQTMPR Number of rows in a temporary table. QQRCOD Reason for building temporary index. Refer to the DB Monitor guide for the specific reason codes Record - Access plan rebuild The QQRCOD field lists the reason the rebuild of the plan is occurring. It is not present on every full open. It only occurs in cases where the access plan already exists but for some reason it must change. This field can help determine the reason for a full open if other DB Monitor records do not show why. 16 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
25 3007 Record - Summary optimization The 3007 record shows a summary of the optimization process, including all indexes evaluated for each given file, including which one, if any, was selected for use in this query, which were not selected, and why. Reason codes are listed next to each index. A reason code of 0 indicates that the index was selected. Other codes are the same as those in the second level text of CPI432C and CPI432D messages. This record indicates whether the optimizer timed out while evaluating the indexes. Indexes are evaluated in order from newest to oldest, in the same order as shown by DSPDBR for the file, excluding views. To ensure an index is evaluated, delete and recreate it. Then it will be first on the list. The record will not appear if indexes do not exist or if only one index exists and it was selected (see 3001 record for this file). The most commonly used fields QQC11 Optimizer timed out (Y or N). QQ1000 Contains library qualified index names, each with a reason code. An index from index build may still occur for the index that was selected (look for the 3002 record). If a time-out occurred, only those indexes that were evaluated will be listed Record - Host variable and ODP implementation The 3010 record shows substitution values for host variables or parameter markers in the query text (refer to QQ1000 field in the 1000 record). This record appears just prior to each instance of an open, update, delete, or insert with subselect. This record does not appear for insert with values. Data may not match exactly for updates with parameter markers in the SET clause. The most commonly used fields QQ1000 Host variable or parameter marker values. Values (separated by commas) correspond left to right with host variables/parameter markers in the corresponding SQL statement. All values show up as characters; no quotes or other indicators denote the value type. All floating point values show up as *F. QQC11 ODP implementation (Reusable, Non-reusable). QQC12 Host variable implementation (interface supplied values, host variable treated has constants, table management row positioning). Figure 11 on page 18 shows a result set for the corresponding predefined query, Data conversion information. Note that in the predefined query, fields like QQC11 - Statement function and QQC12 - Host variable implementation are decoded for clarity. 17
26 Figure 11. Data Conversion predefined report Note: In Figure 11, some columns are truncated to show Statement Text and Host Variable Values. Tip The SQL sentence is reported on field QQ1000 with its control characters such as TAB and Carriage Return Line Feed (CR LF). To see the entire SQL statement, you can increase the height of the row by dragging its bottom row border and then obtain a report like the example in Figure Record - Bitmap created The 3021 record shows that the optimizer decided to construct an index bitmap. To see the index that has been used to construct the bitmap, it is necessary to look at the previous record, which must be a 3001 record, for example: SELECT B.QQILNM, B.QQIFNM, A.QQI2 FROM monitor-file-name A, monitor-file-name B WHERE A.QQRID = 3021 AND RRN(B) = RRN(A) Record - Bitmap merge After one or more combinations of 3001 and 3021 records, there will be a 3022 record, which will indicate a bitmap merge. The QVC3001 field identifies the bitmaps that were merged together Record - Temporal hash table created Hash tables are used in DB2 UDB for AS/400 in two ways: for grouping and for implementing the hash join algorithm. In many cases, using hash tables gives you better performance than index grouping or joining, particularly if you are interested in the total turnaround and not the first fetched row time. In V4R5, DB Monitor captures information about hash tables used for grouping, but it does not capture data for hash join tables. Some useful fields are: QQI2 Number of hash table entries. QQI3 Hash table size. QQI4 Hash table row size. 18 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
27 3028 Record - Grouping QQI5 Hash table key size. QQI7 Hash table pool size. QQI8 Hash table pool id. QVC3001 Columns used to create the hash table. The 3028 record shows you that a grouping was performed and explains which fields were used for grouping, the type of grouping (index or hash) and the index used, where applicable. Some useful fields are: QQC11 Grouping implementation (Hash or Index). QQC101 Index used (or constraint). QQC102 Library name. QVINAM Long name for the index (or constraint). QVILIB Long name for the index or constraint library. QQI2 Estimated number of groups. QQI3 Average of rows in each group. QVC3001 Grouping columns. QVC3002 to QVC3008 Min, max, sum, count, avg, stddev, and var columns respectively. QQC12 Having selection exist (Y/N). QQC13 Having to Where conversion (Y/N). Analyzing SQL statements involving JOINs SQL statements with JOIN are among the most sensitive areas in tuning SQL queries. Unfortunately, there is not a specific record for JOIN information in DB Monitor collected data. The information is contained in the access method records used for the tables that are used in the query. To see the join information, you need to look for the following fields in records 3000 to 3004, 3007, 3021 to 3023, 3027 to 3029, among others: QQJNP Join position QQC21 Join method (NL- Nested loop, MF - Nested loop with selection, HJ - Hash join). Currently DB Monitor can only capture data related to nested loop and nested loop with selection. QQC22 Join type (IN - inner join, PO - Left partial outer join, EX - Exception join). Also present in the 3014 record. QQC23 Join operator: When it uses the nested loop with selection, it is going to show a Cartesian product, even when it is not. QVJFANO Join fan out (Normal, Distinct fanout, Unique fanout). From the example in Figure 12 on page 20, you can see that this operation joins two tables, ITEM_FACT as the primary table and PART_DIM as the secondary table. From the QQC22 field, you see that this is an inner join. Also note that, 19
28 after reviewing indexes ITEM_IDX2 and ITEM_IDX1, ITEM_FACT was accessed using key positioning, based on index ITEM_IDX1 and the reason for using an index is I1, row selection. For the PART_DIM table, a temporary index was created on PARTKEY ascending taking 0.24 sec. No indexes were advised. Is this good enough? There is not an absolute answer to this question. Even if an index is not advised, you can try an index on PART_DIM. Was it easy to analyze? This is a subjective matter, but you can compare it with the visual explanation in Figure 17. SELECT qqrid AS "QQRID Record Type",qqc21 AS "QQC21 Join Method",qqjnp AS "QQJNP Join Position",qqc22 AS "QQC22 Join Type",qqptln AS "QQPTLN Base Library",qqptfn AS "QQPTFN Base Table",QQILNM AS "QQILNM Index Library",QQIFNM AS "QQIFNM Index Name",qq1000,qqrcod,qqetim - qqstim AS "Elapsed Time",qqidxa AS "QQIDXA Index Advised",qvc16 AS "QVC16 Index from Index",'...' AS "...",rrn(a) FROM qzg a WHERE qqucnt = 20 AND qqjfld LIKE '%022086%' ORDER BY RRN(a) Figure 12. DB Monitor information for an SQL Query involving JOINing 3014 Record - Generic query information The 3014 record appears with full open optimization records. In most cases, one 3014 record appears per full open. Multiple 3014 records can appear if the query consists of multiple separately run queries. For example, subqueries with grouping functions or views that need results materialized for use in outer query. Values in this field help identify what type of query this record represents and how long it took to open the cursor for this query. Refer to DB Monitor for other field values. In V4R5, record 3014 has been enriched with many valuable fields that can be used for determining the values of many parameters that affect the behavior of the optimizer. It also has summary information for the query or subquery. 20 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
29 Some of the information you can find there include: QQI1 Time spent to open the cursor (in milliseconds). QQORDG Ordering involved (Y/N). QQGRPG Grouping involved (Y/N). QQJNG Joining involved (Y/N). QQC22 Join type (if it applies). QQI5 Time spent in optimizing. QQC102 Query optimization File (QAQQINI) Library. *N when it was unable to retrieve a query optimization file. QVC16 ALWCPYDTA setting. QVC81 Parallel degree. QVC18 Force join order (Y/N) Plus, there are many others. Other DB Monitor records The following records are not used as much for performance tuning, but can provide other interesting data: 3005 record Table locked record Subquery processing record STRDBMON/ENDDBMON information/option record Records retrieved detail record (only occurs with TYPE(*DETAIL). 21
30 22 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
31 Operations Navigator Visual Explain Visual Explain is a new tool introduced in V4R5. It provides a graphical way of identifying and analyzing SQL performance, providing a graphical representation of the access plan the optimizer generates for a given SQL query. It will identify the tables involved and indexes considered for the query execution as well as join order, type of sort (if required), type of grouping (if required), and other valuable information. Using Visual Explain There are two ways to use Visual Explain: Interactively from an Operations Navigator Run SQL Scripts window From SQL Performance Monitor Using Visual Explain interactively In the Run SQL Scripts window of Operations Navigator, you will find a Visual Explain option on the main menu bar, with three options. Explain will explain the SQL statement where the cursor is positioned, without executing it. Run and Explain will run and then explain the SQL statement where the cursor is positioned. Graphical buttons are also present (see Figure 13). Visual Explain Only Run and Explain Figure 13. Visual Explain menu bar An interesting variation for this method, in a kind of help desk approach, involves right-clicking Database in the Operations Navigator left-hand window and selecting Current SQL for a Job. Follow the instructions to find the current (or last executed) SQL statement for that specific job (see Figure 14 on page 24). Clicking the Edit SQL button opens a Run SQL Scripts window with this statement, ready to be executed or just analyzed. Remember that this Run SQL Scripts is a new job, and may have different SQL runtime environmental properties to the original job. 23
32 Figure 14. Help desk approach Using Visual Explain over DB Monitor collected data Visual Explain can also be used to analyze SQL statements from DB Monitor. It can analyze data captured with Operations Navigator SQL Performance Monitor, detailed option. It can also analyze DB Monitor information captured through the STRDBMON command, both summary or detailed. In this case, the data must be imported to SQL Performance Monitor as explained in Importing an SQL Performance Monitor on page 3. Once the SQL Performance Monitor of interest is located in the Operations Navigator window, right-click List Explainable Statements (Figure 15). A window with the list of explainable statements appears. An SQL statement can be selected by clicking the Date column. The SQL statement appears in the bottom half of the window (see Figure 16). The visual explanation can be obtained by clicking the Run Visual Explain button. 24 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
33 Figure 15. Using Visual Explain from the Operations Navigator SQL Performance Monitor Figure 16. List of explainable statements Visual Explain results Once an SQL statement has been selected for analysis, Visual Explain can be used to graphically describe its access plan, as shown in Figure 17 on page 26. The Visual Explain window is divided into two parts. The left-hand side of the window shows the graphical explanation, while the right-hand side shows the attributes for the highlighted Icon. The following example shows a select statement involving a join. Highlighting each icon and reviewing their attributes, we can learn that, in this join, ITEM_FACT is the primary table and is accessed by key using ITEM_IDX1. PART_DIM is the secondary table in the join and a 25
34 temporary index was built to satisfy the join needs. The estimated number of rows to be selected from ITEM_FACT was 678 and for PART_DIM was 20,000, which explains the join order. This example corresponds to the one used in Analyzing SQL statements involving JOINs on page 19. Figure 17. Visual Explain over an SQL statement involving JOINing We now have a complete set of tools for tuning SQL statements, with SQL Performance Monitor summary and its predefined reports helping us detect the jobs that require further analysis, SQL Performance Monitor detailed and its predefined reports helping us to detect the SQL statements requiring further analysis and Visual Explain giving us a readable and easy to understand graph of the access plan for a particular SQL query. 26 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
35 Database performance analysis There are many different methods to identify problems and tune troublesome database queries. One of the most common methods is to identify the most dominating, time-consuming queries and work on each of them individually. Another method is to leverage global information and to use this information to look for indexes that are begging to be created. A set of queries have been included in this section. These queries have been designed to help produce useful results in most situations. Using these queries will help you to understand the data and to learn to construct other queries as well. Query analysis is iterative in nature. Try something running the job (with the DB Monitor active) or the individual query (using Operations Navigator Run SQL Script with Include Debug Messages in Job Log set on or STRSQL using debug messages) to see if it worked. Try it again if it did not work. When using the STRSQL command, ensure that the appropriate settings are used for the Data refresh and Allow copy data options. These settings can be changed by using the Change Session Attributes option in STRSQL. For example, JDBC uses *FORWARD for Data refresh and *OPTIMIZE for Allow copy data. The defaults are *ALWAYS for Data refresh and *YES for Allow copy data. It is usually best to first concentrate on repetitious non-reusable ODPs, table scans, and long index builds. Also, look for repetitious short-running queries that are not optimized well. Joins and sorts can be more difficult to analyze. If joins and sorts are accounting for a significant portion of run time they need to be addressed as well. Fine tuning smaller problems should be done after large problems have been addressed. Generally, indexes will be used to tune most performance problem areas. Database performance problems that are not easily avoidable Problems that are generally not simple to rectify include: Full opens due to repetitive query using new literal values each time it's invoked: If the prepared statement text differs in any way from any previous SQL statement in that job, a full open and new ODP will be needed. SQL will, in most cases, attempt to convert literals to parameter markers to make the repetitive statement appear identical each time. However, literals cannot be converted in the following cases: Parameter marker conversion turned off Original SQL statement contains both parameter markers and literals Statement uses special registers (CURRENT DATE, CURRENT TIME) Expressions used in SET or SELECT clause of statement Non-reusable ODPs due to: Before V4R5, temporary results table created for ODP (3004 record appears in the full open). Now temporary tables are cleared between statement executions to allow reuse of the ODP. Group by fields on more than one file or view with grouping (materialization). 27
36 Although the full opens listed here are not avoidable, they can still possibly be improved. For example, an open might contain a 3004 record but might also contain a costly temporary index build that can be avoided by building a new permanent index. Look at the opens to see what can be done. Time-consuming queries due to: Correlated subqueries run excessive number of times within a query. NOTEXISTS forcing poor join order. Updates or deletes with poor join performance because the file being changed is forced to be first in join. Remember In V4R5, the modern join syntax does not force join order as in previous releases. Two new parameters were added to the QAQQINI file for controling join implementation: FORCE_JOIN_ORDER (with values *DEFAULT or *FORCE) and STAR_JOIN (with values *DEFAULT or *FORCE). Long running index builds with mapped keys in the build (the 3002 record has *MAP in QQ1000). Some programming practices cause unnecessary data conversion that derived in *MAP fields that can be avoided with small changes in the SQL statement. Problems that are generally avoidable Problems that are relatively easy to resolve include: Temporary indexes created for join, order by or group by: Individual long-running or repeated index creates (non-reusable ODPs). A 3002 record exists in the full open (without *MAP in QQ1000 field). Time-consuming queries due to: Table scans - single long-running or repetitious short-running A 3000 record exists in the full open (unless the open is done for a file that is being inserted into). Poor join order Need to be familiar with what a better join order would be and how to influence optimizer. Temporary sort being done when index approach feasible and faster A 3003 record exists in the full open and possibly longer opens in reusable ODP mode. Reusable ODPs with a good initial access plan that become worse due to table growth Watch the QQI6 or the QQI4 value in the 1000 records to see if the value grows. Try to influence the optimizer to an initial access plan that is not affected by table growth. 28 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
37 Creating indexes It is helpful to know how data in the table is populated and how selective certain key fields are. This information can be used to help create indexes that will be used for a large number of queries. It can also help to know why existing indexes were not used in some situations. For example, if a query has WHERE A =? AND B =? AND C =? and there is an index over A, B and C but the database optimizer decides not to use it, it may be because these fields are not very selective. Knowing the data can help to quickly detect this. If the selective of certain fields are not known, the fields can be queried to find out: SELECT A, B, C, COUNT(*) FROM TABLEA GROUP BY A, B, C ORDER BY 4 DESC Try to create indexes that are used more globally. Use selective fields that are commonly used in WHEREs, and where applicable, use them in combination with common join, order by, and group by keys. If index is uniquely keyed, create the index as UNIQUE since this is useful to the database optimizer. Do not create a lot of permanent indexes trying to cover every combination. Create one or two that are potentially good, run the job again or run the STRSQL command for a single query and see if they are used. If the indexes are used and the run time is noticeably better, consider deploying the indexes for permanent use. If the indexes are not used, delete them and try a different combination. Do not create indexes just to solve a single instance of a full open or query unless it accounts for a significant amount of time. Each additional index created for a table will cause overhead when: Updates to the table include the index keys Rows are inserted or deleted for the table Full opens occur for that file (index evaluation) For faster analysis The DB Monitor file often is large and contains information on many jobs. Therefore, running queries on the data can sometimes be slower than desired. Users can try to help this by collecting only the job they want. However, sometimes this is not possible and, even if it is, batch jobs can generate a lot of DB Monitor output. Also, using interactive tools such as STRSQL, can result in longer run times on server models. If the response time is slow during the analysis, consider the following tips: Create a smaller DB Monitor file with only the records you are interested in: Build and run a query to select only those jobs you're interested in. Then, copy the records for those jobs into a separate DB Monitor file. CRTDUPOBJ and INSERT with subselect specifying the QQJNUM value or values. Create indexes on the DB Monitor file over the common selection and grouping/order by clauses. 29
38 Examples of some key combinations to use are: QQRID, QQC21 QQJFLD, QQUCNT & QQI5 QQRID & QQ1000 QQRID & QQC21 Try other combinations as needed. Remember, combine the selection and grouping/order by clauses. When you use Operations Navigator to start a detailed SQL Performance Monitor, as soon as you end the data collection, it will provide you with a couple of indexes, one based on QQJFLD, QQUCNT & QQI5 and another based on QQRID & QQC21. Altering insert with subselect data in a Monitor file Within the DB Monitor file, inserts with subselects actually contain two QQUCNTs. The first one is listed for subselect optimization messages during a full open. The second one is for the actual insert statement and each instance of the reusable ODP after that. This can be a problem when trying to look at the optimization messages for the subselect using the QQUCNT record for the insert operation itself. There is no easy way to view this. The problem is being addressed, but for now, use the following method to correct this problem. UPDATE monitor-file-name SET QQUCNT = QQUCNT + 1 WHERE QQJFLD DIGITS(QQUCNT) IN (SELECT DISTINCT QQJFLD DIGITS(QQUCNT) FROM monitor-file-name WHERE QQC21 = IN AND UPPER(QQ1000) NOT LIKE %VALUES% AND QQI5 = 0) DB Monitor query examples 1 through 13 Here we present a series of queries to help solve specific questions in the detection and resolution of SQL performance issues. Most of these queries have more elaborate equivalents in the SQL Performance Monitor predefined reports as we indicate below. However, it is still useful to be familiar with the DB Monitor table. Example 1: Identify the specific job(s) to analyze From the Job Summary predefined report (see Reported DB Monitor record types on page 8), pick out the jobs that use the most run time. Use the Job Number value as selection in other analysis steps. If only one job is monitored or one job completely dominates the others, Job Number is not needed. If the job cannot be identified from this information, then work with the customer or use other tools, like WRKSYSACT, to determine the job. Example 2: Which type of SQL operations account for the most run time The Operation Summary predefined report shows the number of SQL operations (Open, Prepare... Describe, Close, Call, Fetch,...) used and how much elapsed time is spent by each type of operation. The results from this query can help to 30 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
39 know what to concentrate on for the most potential payback (selects, updates, etc.). Example 3: Which SQL operations account for the most run time (list by text) The Basic Statement Information into Detail Result tab shows the text of the SQL operations that account for the most run time and the number of times they were run. It also shows valuable information, such as type of ODP (reusable or non-reusable), number of table scans, number of indexes created, number of indexes used, number of indexes, etc. Example 4: Which queries account for the most run time (list by QQUCNT) SELECT SUM(QQI4), COUNT(*), QQUCNT, QQJFLD FROM monitor-file-name WHERE QQRID = 1000 AND QQC21 <> 'MT' AND QQUCNT <> 0 GROUP BY QQUCNT, QQJFLD ORDER BY 1 DESC This query shows individual query instances and how much time they took, sorted by the run time (largest to smallest). It also includes fetch and close time for opens. It does not include non-odp SQL operations such as prepare or describe (QQUCNT=0). This provides a way to quickly find a query that is taking a large amount of time without having to know the text or anything else about that query. Consider limiting QQC21 values to look at certain query type. If there is not a single dominating query or set of queries, and if Example 3 does not provide the information that is needed, go to Example 5. The equivalent predefined query is Basic Statement Information from the Extended Detailed Result tab. Example 5: Which queries account for the most run time SELECT QQJFLD, QQUCNT, QQ1000,SUM(QQI4), COUNT(*) FROM monitor-file-name WHERE QQRID = 1000 AND QQC21 <> 'MT' AND QQUCNT <> 0 GROUP BY QQ1000,QQUCNT, QQJFLD ORDER BY QQJFLD, QQUCNT, 1 DESC The results of this query show all parts of a query grouped together and listed by QQUCNT. Fetches and closes are listed together with their corresponding opens. It does not include non-odp operations (prepare, describe, commit, etc.). Scroll through the unique queries to see the most expensive ones, and use the QQUCNT record to further analyze them (see Example 6). The query can be changed to sort by text and run time (4, 1 DESC) to group similar queries together and see which are the most costly or just by run time to see the most costly overall. It may also be useful to add QQC21 values to select a certain query type. Example 6: How do I determine how an individual query was run SELECT QQRID, QQPTFN, QQIFNM, QQC21, QQI4, QQ1000 FROM monitor-file-name WHERE QQJNUM = 'job-number' AND QQUCNT = query-number The fields used in this query are a good starting point, but there are other fields that can help to determine what the query is doing and the access plan that was used. For example, to find how long an index build within this query is taking, replace QQI4 with QQETIM-QQSTIM. If full open data was collected, optimization 31
40 records will appear first followed by the 1000 records, then repeated instances of the query if the ODP was reusable. The text of the query along with the host variable values from the 3010 record can be used to reconstruct the query for debug purposes. For this purpose, Visual Explain represents an outstanding tool. Under the covers, Visual Explain interprets the contents of DB Monitor table and represents it graphically. Figure 18 and Figure 19 shows a parallel between the way Visual Explain graphs a specific query and the records on DB Monitor for the same query. DB Monitor fields are mapped in the Attribute window. Fly-over window with a information summary. Access method are represented with icons in Visual Explain. Figure 18. Visual Explain to DB Monitor icon mapping on a single Table Scan selection 32 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
41 Figure 19. Visual Explain to DB Monitor icon mapping on a more complex query Note For mapping each icon with its respective field in the DB Monitor table, it is necessary to show more fields than are shown. Example 7: Which queries are significantly affected by full opens The Open Information from the Detailed Results tab points out queries whose run time is noticeably affected by full opens. Open Information from the Extended Detailed Results tab also includes the SQL statement text. Use Example 8 to find any individual queries that are doing full opens. Example 8: List all queries (sorted by text) that are doing full opens SELECT QQI4, QQUCNT, QQ1000 FROM monitor-file-name WHERE QQJNUM = 'job-number' AND QQRID = 1000 AND QQI5 = 0 33
42 AND QQC21 IN ('OP', 'DL', 'IN', 'UP') ORDER BY 3, 1 DESC This query groups together queries that are doing full opens. Scroll through the list to find repetitive queries. Select QQUCNT from one of these and use it to look at the query to understand why it is doing a full open. Remember to look closely at the text. If it is a new SQL statement, the open cannot be avoided since SQL must create an ODP the first time. Look at certain query types by limiting the QQC21 list and sort by QQI4 to see the most costly opens. Remember that the first full open for each unique query is unavoidable, although it may be possible to improve them in some cases. Example 9: List all queries with full opens that contain a temporary index build SELECT QQI4, QQUCNT, QQ1000 FROM monitor-file-name WHERE QQJNUM = 'job-number' AND QQRID = 1000 AND QQI5 = 0 AND QQC21 IN ('OP', 'DL', IN', 'UP') AND QQUCNT IN ( SELECT DISTINCT QQUCNT FROM monitor-file-name WHERE QQJNUM = 'job-number' AND QQRID = 3002 AND QQ1000 NOT LIKE '%*MAP%') ORDER BY 3, 1 DESC This query helps to quickly locate queries that are doing temporary index builds. It provides the QQUCNT values that can be used to look at the query optimization to find more information. First, sort by QQI4 first to find the most expensive opens. This does not necessarily mean that the open can be avoided. There may be other reasons the full open is occurring besides the temporary index build. Example 10: Which index builds are done most often The Basic Statement Information from the Detailed Results tab can show you how many temporary indexes were created by each SQL Statement. Basic Statement Information from the Extended Detailed Results tab shows you details on each one of those indexes. But if you are interested in counting the number of times the same index was created, the following query will be useful: SELECT QQUCNT, QQETIM-QQSTIM, QQPTFN, QQTOTR, QQRIDX, QQRCOD, QQIDXA, SUBSTR(QQ1000, 1, 100), SUBSTR(QQIDXD, 1, 100) FROM monitor-file-name WHERE QQRID = 3002 ORDER BY 8 This query points out commonly occurring index creates and how to create permanent indexes to avoid them. Look for repeated index builds or long index builds first. If an index build only occurs once and is not costly, it may be best to let it occur. The SUBSTR for QQ1000 and QQIDXD should cover most key lists, but it may be necessary to increase the respective values if 100 bytes is not enough. Use the following methods to determine what keys to use to build a permanent index: If QQTOTR = QQRIDX, the keys from QQ1000 for the index build will probably be acceptable. 34 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
43 If QQTOTR > QQRIDX, additional selection keys should be in the index along with the join, order by, or group by keys from the QQ1000 field. The fields from QQIDXD can be used, if available. However, it may be desirable to add QQI2 to the selection to know the number of primary keys. If there is no data in QQIDXD or the keys from QQIDXD do not seem to work, get the most selective keys from the query text itself. Use QQUCNT to find the query text. Example 11: Which full opens are not avoidable due to temporary table results WITH AA AS (SELECT DISTINCT QQJFLD, QQUCNT, QQRCOD FROM monitor-file-name WHERE QQRID = 3004) SELECT A.QQUCNT, A.QQC21, A.QQI4, A.QVC14, B.QQRCOD, A.QQ1000 FROM monitor-file-name A, AA B WHERE -- Selection condition A.QQRID = 1000 AND A.QQI5 = 0 AND A.QQC21 IN ('OP', 'IN', 'UP', 'DL') AND -- Join Condition A.QQUCNT = B.QQUCNT AND B.QQJFLD = B.QQJFLD ORDER BY 4, 3 DESC This query shows all full opens that are unavoidable due to temporary results table and groups them by text and run time. The QQRCOD field shows the reason code for the temporary table. Often it is useful to sum on QQI4 and group on QQ1000 to determine the overall cost. It still may be possible to improve the cost of the open. Use QQUCNT to see if the query can be optimized better or if other tunable items, such as index build, exist. Example 12: Which queries involve an arrival sequence WITH R3000 AS ( SELECT DISTINCT QQUCNT, QQJFLD, QQRCOD FROM monitor-file-name WHERE QQRID = 3000 AND QQJNUM = 'job-number') SELECT SUM(QQI4), COUNT(*), A.QQUCNT, B.QQRCOD, QQ1000 FROM monitor-file-name A, R3000 B WHERE A.QQJFLD = B.QQJFLD AND A.QQUCNT = B.QQUCNT AND A.QQRID = 1000 GROUP BY A.QQUCNT, B.QQRCOD, QQ1000 ORDER BY 1 DESC This query lists the most expensive SQL operations that are using arrival sequence. The presence of a 3000 record does not necessarily cause bad performance (inserts, bit maps, and scans of small files). Use the QQUCNT record to look at the most expensive operations to see how much the file using arrival sequence is affecting the query. Look for fetches that are costly per fetch since this can suggest that a table scan is being done on a large file prime candidate for creating a new index. It may be useful to order by QQUCNT since this lists the specific operations (for example, fetch) with the corresponding open/close. The equivalent predefined query is Table Scan Information into Detail or Extended Detail Result tabs. 35
44 Example 13: Which queries involve the use of a query sort WITH R3003 AS ( SELECT DISTINCT QQUCNT, QQJFLD, QQRCOD FROM monitor-file-name WHERE QQRID = 3003 AND QQJNUM = 'job-number') SELECT SUM(QQI4), COUNT(*), A.QQUCNT, B.QQRCOD, QQ1000 FROM monitor-file-name A, R3003 B WHERE A.QQJFLD = B.QQJFLD AND A.QQUCNT = B.QQUCNT AND A.QQRID = 1000 GROUP BY A.QQUCNT, B.QQRCOD, QQ1000 ORDER BY 1 DESC This query lists the most expensive SQL queries that are using a query sort. The presence of a 3003 record does not necessarily indicate poor performance. Use QQUCNT to look at the most expensive opens (selects). Look for opens (selects) that are costly per open. A sort may be required. See the QQRCOD field in the 3003 record. If it is not required, determine if an index would help. It may be useful to order by QQUCNT since this lists the specific operations (for example, fetch) with the corresponding open/close. End user query tools Once a basic understanding of the queries that can be used to query the Database Monitor output is gained, the next step is to become efficient at using the queries. A variety of query tools exist that can help access the data from the Database Monitor: Operations Navigator: Run SQL Script Interactive SQL Query/400 DB2 UDB for AS/400 Query Manager Of the query tools listed above, DB2 UDB for AS/400 Query Manager (LLP 5769-ST1) is the most flexible for composing, executing, and managing reports from queries. The DB2 UDB for AS/400 Query Manager allows user variables in queries so that items like the database filename can be selected when the query is run, instead of when the query is written. DB2 UDB for AS/400 Query Manager Report Forms make formatting output of queries easier by generating column headings, spacing, and field wrapping for more readable end-used reports. You can locate DB2 UDB for AS/400 Query Manager User Guide, SC , on the Web at: Summary Tuning SQL statements and database performance can be a very demanding task. Performance analysis of database problems can be difficult and time-consuming. Now, with the tools introduced in V4R5, such as Visual Explain and SQL Performance Monitor predefined reports, it is becoming more accessible. Performance tuning, particularly when dealing with database operations, is an iterative process but the availability and knowledge of powerful tools allow the performance analyst to find a solution quickly. 36 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
45 Knowledge and judicious usage of the OS/400 Database Monitor tool, its predefined queries, Visual Explain and the detailed queries provided in this document allow the analyst to gain more information about how the application SQL statements are performing and what can be done to improve their behavior. The time it takes for the performance analyst to understand the database problems and solve them can be reduced significantly by using this tools. Additional information and author contacts Special thanks goes to Dale Weber for the usage of his SQL class foils used to develop this redpaper. IBM Global Services at Rochester, MN, offer technical support for Performance Analysis & Capacity Planning of AS/400 products. Their services are described at: Additional information regarding AS/400 and UDB DB2/400 and the Database Performance Monitor is available on the AS/400 home page beginning at: Questions regarding the conclusion reached in this redpaper should be addressed to Rick Peterson or Richard Odell Copyright International Business Machines, All Rights Reserved. 37
46 38 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
47 Appendix A. Special notices This publication is intended to help programmers, analysts, and database administrators to identify and tune SQL queries. The information in this publication is not intended as the specification of any programming interfaces that are provided by DB2 UDB for AS/400. See the PUBLICATIONS section of the IBM Programming Announcement for DB2 UDB for AS/400 for more information about what publications are considered to be product documentation. References in this publication to IBM products, programs or services do not imply that IBM intends to make these available in all countries in which IBM operates. Any reference to an IBM product, program, or service is not intended to state or imply that only IBM's product, program, or service may be used. Any functionally equivalent program that does not infringe any of IBM's intellectual property rights may be used instead of the IBM product, program or service. Information in this book was developed in conjunction with use of the equipment specified, and is limited in application to those specific hardware and software products and levels. IBM may have patents or pending patent applications covering subject matter in this document. The furnishing of this document does not give you any license to these patents. You can send license inquiries, in writing, to the IBM Director of Licensing, IBM Corporation, North Castle Drive, Armonk, NY Licensees of this program who wish to have information about it for the purpose of enabling: (i) the exchange of information between independently created programs and other programs (including this one) and (ii) the mutual use of the information which has been exchanged, should contact IBM Corporation, Dept. 600A, Mail Drop 1329, Somers, NY USA. Such information may be available, subject to appropriate terms and conditions, including in some cases, payment of a fee. The information contained in this document has not been submitted to any formal IBM test and is distributed AS IS. The use of this information or the implementation of any of these techniques is a customer responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. While each item may have been reviewed by IBM for accuracy in a specific situation, there is no guarantee that the same or similar results will be obtained elsewhere. Customers attempting to adapt these techniques to their own environments do so at their own risk. Any pointers in this publication to external Web sites are provided for convenience only and do not in any manner serve as an endorsement of these Web sites. The following terms are trademarks of the International Business Machines Corporation in the United States and/or other countries: e (logo) IBM â AS/400 CT DB2 Redbooks Redbooks Logo AT Current DB2 Universal Database Copyright IBM Corp. 2000,
48 OS/ SP The following terms are trademarks of other companies: Tivoli, Manage. Anything. Anywhere.,The Power To Manage., Anything. Anywhere.,TME, NetView, Cross-Site, Tivoli Ready, Tivoli Certified, Planet Tivoli, and Tivoli Enterprise are trademarks or registered trademarks of Tivoli Systems Inc., an IBM company, in the United States, other countries, or both. In Denmark, Tivoli is a trademark licensed from Kjøbenhavns Sommer - Tivoli A/S. C-bus is a trademark of Corollary, Inc. in the United States and/or other countries. Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and/or other countries. Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States and/or other countries. PC Direct is a trademark of Ziff Communications Company in the United States and/or other countries and is used by IBM Corporation under license. ActionMedia, LANDesk, MMX, Pentium and ProShare are trademarks of Intel Corporation in the United States and/or other countries. UNIX is a registered trademark in the United States and other countries licensed exclusively through The Open Group. SET, SET Secure Electronic Transaction, and the SET Logo are trademarks owned by SET Secure Electronic Transaction LLC. Other company, product, and service names may be trademarks or service marks of others. 40 Using AS/400 Database Monitor and Visual Explain To Identify and Tune SQL Queries
Using AS/400 Database Monitor To Identify and Tune SQL Queries
by Rick Peterson Dale Weber Richard Odell Greg Leibfried AS/400 System Performance IBM Rochester Lab May 2000 Page 1 Table of Contents Introduction... Page 4 What is the Database Monitor for AS/400 tool?...
2 SQL in iseries Navigator
2 SQL in iseries Navigator In V4R4, IBM added an SQL scripting tool to the standard features included within iseries Navigator and has continued enhancing it in subsequent releases. Because standard features
DB2 for i5/os: Tuning for Performance
DB2 for i5/os: Tuning for Performance Jackie Jansen Senior Consulting IT Specialist [email protected] August 2007 Agenda Query Optimization Index Design Materialized Query Tables Parallel Processing Optimization
ERserver. iseries. Work management
ERserver iseries Work management ERserver iseries Work management Copyright International Business Machines Corporation 1998, 2002. All rights reserved. US Government Users Restricted Rights Use, duplication
MyOra 3.0. User Guide. SQL Tool for Oracle. Jayam Systems, LLC
MyOra 3.0 SQL Tool for Oracle User Guide Jayam Systems, LLC Contents Features... 4 Connecting to the Database... 5 Login... 5 Login History... 6 Connection Indicator... 6 Closing the Connection... 7 SQL
DB2 for i. Analysis and Tuning. Mike Cain IBM DB2 for i Center of Excellence. [email protected]
DB2 for i Monitoring, Analysis and Tuning Mike Cain IBM DB2 for i Center of Excellence Rochester, MN USA [email protected] 8 Copyright IBM Corporation, 2008. All Rights Reserved. This publication may refer
Oracle Database: SQL and PL/SQL Fundamentals
Oracle University Contact Us: 1.800.529.0165 Oracle Database: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn This course is designed to deliver the fundamentals of SQL and PL/SQL along
Version 5.0. MIMIX ha1 and MIMIX ha Lite for IBM i5/os. Using MIMIX. Published: May 2008 level 5.0.13.00. Copyrights, Trademarks, and Notices
Version 5.0 MIMIX ha1 and MIMIX ha Lite for IBM i5/os Using MIMIX Published: May 2008 level 5.0.13.00 Copyrights, Trademarks, and Notices Product conventions... 10 Menus and commands... 10 Accessing online
Data Tool Platform SQL Development Tools
Data Tool Platform SQL Development Tools ekapner Contents Setting SQL Development Preferences...5 Execution Plan View Options Preferences...5 General Preferences...5 Label Decorations Preferences...6
Oracle Database: SQL and PL/SQL Fundamentals NEW
Oracle University Contact Us: + 38516306373 Oracle Database: SQL and PL/SQL Fundamentals NEW Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals training delivers the
Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff
D80198GC10 Oracle Database 12c SQL and Fundamentals Summary Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff Level Professional Delivery Method Instructor-led
Tips and Tricks SAGE ACCPAC INTELLIGENCE
Tips and Tricks SAGE ACCPAC INTELLIGENCE 1 Table of Contents Auto e-mailing reports... 4 Automatically Running Macros... 7 Creating new Macros from Excel... 8 Compact Metadata Functionality... 9 Copying,
Tutorial 3. Maintaining and Querying a Database
Tutorial 3 Maintaining and Querying a Database Microsoft Access 2010 Objectives Find, modify, and delete records in a table Learn how to use the Query window in Design view Create, run, and save queries
Microsoft Office 2010
Access Tutorial 3 Maintaining and Querying a Database Microsoft Office 2010 Objectives Find, modify, and delete records in a table Learn how to use the Query window in Design view Create, run, and save
Database Administration with MySQL
Database Administration with MySQL Suitable For: Database administrators and system administrators who need to manage MySQL based services. Prerequisites: Practical knowledge of SQL Some knowledge of relational
MyOra 3.5. User Guide. SQL Tool for Oracle. Kris Murthy
MyOra 3.5 SQL Tool for Oracle User Guide Kris Murthy Contents Features... 4 Connecting to the Database... 5 Login... 5 Login History... 6 Connection Indicator... 6 Closing the Connection... 7 SQL Editor...
Decision Support AITS University Administration. Web Intelligence Rich Client 4.1 User Guide
Decision Support AITS University Administration Web Intelligence Rich Client 4.1 User Guide 2 P age Web Intelligence 4.1 User Guide Web Intelligence 4.1 User Guide Contents Getting Started in Web Intelligence
Oracle Database: SQL and PL/SQL Fundamentals
Oracle University Contact Us: +966 12 739 894 Oracle Database: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals training is designed to
ICE for Eclipse. Release 9.0.1
ICE for Eclipse Release 9.0.1 Disclaimer This document is for informational purposes only and is subject to change without notice. This document and its contents, including the viewpoints, dates and functional
Systems Management Advanced job scheduler
System i Systems Management Advanced job scheduler Version 5 Release 4 System i Systems Management Advanced job scheduler Version 5 Release 4 Note Before using this information and the product it supports,
Performance Tuning for the Teradata Database
Performance Tuning for the Teradata Database Matthew W Froemsdorf Teradata Partner Engineering and Technical Consulting - i - Document Changes Rev. Date Section Comment 1.0 2010-10-26 All Initial document
Citrix EdgeSight for Load Testing User s Guide. Citrx EdgeSight for Load Testing 2.7
Citrix EdgeSight for Load Testing User s Guide Citrx EdgeSight for Load Testing 2.7 Copyright Use of the product documented in this guide is subject to your prior acceptance of the End User License Agreement.
Using the Query Analyzer
Using the Query Analyzer Using the Query Analyzer Objectives Explore the Query Analyzer user interface. Learn how to use the menu items and toolbars to work with SQL Server data and objects. Use object
SAP Business Objects Business Intelligence platform Document Version: 4.1 Support Package 7 2015-11-24. Data Federation Administration Tool Guide
SAP Business Objects Business Intelligence platform Document Version: 4.1 Support Package 7 2015-11-24 Data Federation Administration Tool Guide Content 1 What's new in the.... 5 2 Introduction to administration
Teradata SQL Assistant Version 13.0 (.Net) Enhancements and Differences. Mike Dempsey
Teradata SQL Assistant Version 13.0 (.Net) Enhancements and Differences by Mike Dempsey Overview SQL Assistant 13.0 is an entirely new application that has been re-designed from the ground up. It has been
Intro to Embedded SQL Programming for ILE RPG Developers
Intro to Embedded SQL Programming for ILE RPG Developers Dan Cruikshank DB2 for i Center of Excellence 1 Agenda Reasons for using Embedded SQL Getting started with Embedded SQL Using Host Variables Using
Data Access Guide. BusinessObjects 11. Windows and UNIX
Data Access Guide BusinessObjects 11 Windows and UNIX 1 Copyright Trademarks Use restrictions Patents Copyright 2004 Business Objects. All rights reserved. If you find any problems with this documentation,
IBM Power Systems Software. The ABCs of Coding High Performance SQL Apps DB2 for IBM i. Presented by Jarek Miszczyk IBM Rochester, ISV Enablement
The ABCs of Coding High Performance SQL Apps DB2 for IBM i Presented by Jarek Miszczyk IBM Rochester, ISV Enablement 2008 IBM Corporation SQL Interfaces ODBC / JDBC / ADO / DRDA / XDA Network Host Server
Microsoft Access Basics
Microsoft Access Basics 2006 ipic Development Group, LLC Authored by James D Ballotti Microsoft, Access, Excel, Word, and Office are registered trademarks of the Microsoft Corporation Version 1 - Revision
Optimizing the Performance of the Oracle BI Applications using Oracle Datawarehousing Features and Oracle DAC 10.1.3.4.1
Optimizing the Performance of the Oracle BI Applications using Oracle Datawarehousing Features and Oracle DAC 10.1.3.4.1 Mark Rittman, Director, Rittman Mead Consulting for Collaborate 09, Florida, USA,
Microsoft Access 3: Understanding and Creating Queries
Microsoft Access 3: Understanding and Creating Queries In Access Level 2, we learned how to perform basic data retrievals by using Search & Replace functions and Sort & Filter functions. For more complex
DiskPulse DISK CHANGE MONITOR
DiskPulse DISK CHANGE MONITOR User Manual Version 7.9 Oct 2015 www.diskpulse.com [email protected] 1 1 DiskPulse Overview...3 2 DiskPulse Product Versions...5 3 Using Desktop Product Version...6 3.1 Product
Oracle Database: SQL and PL/SQL Fundamentals NEW
Oracle University Contact Us: 001-855-844-3881 & 001-800-514-06-97 Oracle Database: SQL and PL/SQL Fundamentals NEW Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals
There are numerous ways to access monitors:
Remote Monitors REMOTE MONITORS... 1 Overview... 1 Accessing Monitors... 1 Creating Monitors... 2 Monitor Wizard Options... 11 Editing the Monitor Configuration... 14 Status... 15 Location... 17 Alerting...
Crystal Reports Payroll Exercise
Crystal Reports Payroll Exercise Objective This document provides step-by-step instructions on how to build a basic report on Crystal Reports XI on the MUNIS System supported by MAISD. The exercise will
DBA Tools with System i Navigator
DBA Tools with System i Navigator Doug Mack [email protected] IBM DB2 for i Center of Excellence Follow us @IBMpowersystems Learn more at www.ibm.com/power 1 2013 IBM Corporation Why do I need a DBA? 2
ERserver. iseries. DB2 Universal Database for iseries - Database Performance and Query Optimization
ERserver iseries DB2 Universal Database for iseries - Database Performance and Query Optimization ERserver iseries DB2 Universal Database for iseries - Database Performance and Query Optimization Copyright
Monitoring Agent for PostgreSQL 1.0.0 Fix Pack 10. Reference IBM
Monitoring Agent for PostgreSQL 1.0.0 Fix Pack 10 Reference IBM Monitoring Agent for PostgreSQL 1.0.0 Fix Pack 10 Reference IBM Note Before using this information and the product it supports, read the
Access Control and Audit Trail Software
Varian, Inc. 2700 Mitchell Drive Walnut Creek, CA 94598-1675/USA Access Control and Audit Trail Software Operation Manual Varian, Inc. 2002 03-914941-00:3 Table of Contents Introduction... 1 Access Control
Table of Contents. Chapter 1: Introduction. Chapter 2: Getting Started. Chapter 3: Standard Functionality. Chapter 4: Module Descriptions
Table of Contents Chapter 1: Introduction Chapter 2: Getting Started Chapter 3: Standard Functionality Chapter 4: Module Descriptions Table of Contents Table of Contents Chapter 5: Administration Table
WebSphere Business Monitor
WebSphere Business Monitor Dashboards 2010 IBM Corporation This presentation should provide an overview of the dashboard widgets for use with WebSphere Business Monitor. WBPM_Monitor_Dashboards.ppt Page
Business Intelligence Tutorial
IBM DB2 Universal Database Business Intelligence Tutorial Version 7 IBM DB2 Universal Database Business Intelligence Tutorial Version 7 Before using this information and the product it supports, be sure
Access Tutorial 3 Maintaining and Querying a Database. Microsoft Office 2013 Enhanced
Access Tutorial 3 Maintaining and Querying a Database Microsoft Office 2013 Enhanced Objectives Session 3.1 Find, modify, and delete records in a table Hide and unhide fields in a datasheet Work in the
Tutorial 3 Maintaining and Querying a Database
Tutorial 3 Maintaining and Querying a Database Microsoft Access 2013 Objectives Session 3.1 Find, modify, and delete records in a table Hide and unhide fields in a datasheet Work in the Query window in
In this session, we use the table ZZTELE with approx. 115,000 records for the examples. The primary key is defined on the columns NAME,VORNAME,STR
1 2 2 3 In this session, we use the table ZZTELE with approx. 115,000 records for the examples. The primary key is defined on the columns NAME,VORNAME,STR The uniqueness of the primary key ensures that
ODBC Driver Version 4 Manual
ODBC Driver Version 4 Manual Revision Date 12/05/2007 HanDBase is a Registered Trademark of DDH Software, Inc. All information contained in this manual and all software applications mentioned in this manual
ENHANCEMENTS TO SQL SERVER COLUMN STORES. Anuhya Mallempati #2610771
ENHANCEMENTS TO SQL SERVER COLUMN STORES Anuhya Mallempati #2610771 CONTENTS Abstract Introduction Column store indexes Batch mode processing Other Enhancements Conclusion ABSTRACT SQL server introduced
Oracle Database 11 g Performance Tuning. Recipes. Sam R. Alapati Darl Kuhn Bill Padfield. Apress*
Oracle Database 11 g Performance Tuning Recipes Sam R. Alapati Darl Kuhn Bill Padfield Apress* Contents About the Authors About the Technical Reviewer Acknowledgments xvi xvii xviii Chapter 1: Optimizing
Hypercosm. Studio. www.hypercosm.com
Hypercosm Studio www.hypercosm.com Hypercosm Studio Guide 3 Revision: November 2005 Copyright 2005 Hypercosm LLC All rights reserved. Hypercosm, OMAR, Hypercosm 3D Player, and Hypercosm Studio are trademarks
Database Programming with PL/SQL: Learning Objectives
Database Programming with PL/SQL: Learning Objectives This course covers PL/SQL, a procedural language extension to SQL. Through an innovative project-based approach, students learn procedural logic constructs
MicroStrategy Desktop
MicroStrategy Desktop Quick Start Guide MicroStrategy Desktop is designed to enable business professionals like you to explore data, simply and without needing direct support from IT. 1 Import data from
3 Setting up Databases on a Microsoft SQL 7.0 Server
3 Setting up Databases on a Microsoft SQL 7.0 Server Overview of the Installation Process To set up GoldMine properly, you must follow a sequence of steps to install GoldMine s program files, and the other
MAS 500 Intelligence Tips and Tricks Booklet Vol. 1
MAS 500 Intelligence Tips and Tricks Booklet Vol. 1 1 Contents Accessing the Sage MAS Intelligence Reports... 3 Copying, Pasting and Renaming Reports... 4 To create a new report from an existing report...
SAS. Cloud. Account Administrator s Guide. SAS Documentation
SAS Cloud Account Administrator s Guide SAS Documentation The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2014. SAS Cloud: Account Administrator's Guide. Cary, NC:
Results CRM 2012 User Manual
Results CRM 2012 User Manual A Guide to Using Results CRM Standard, Results CRM Plus, & Results CRM Business Suite Table of Contents Installation Instructions... 1 Single User & Evaluation Installation
How To Use The Correlog With The Cpl Powerpoint Powerpoint Cpl.Org Powerpoint.Org (Powerpoint) Powerpoint (Powerplst) And Powerpoint 2 (Powerstation) (Powerpoints) (Operations
orrelog SQL Table Monitor Adapter Users Manual http://www.correlog.com mailto:[email protected] CorreLog, SQL Table Monitor Users Manual Copyright 2008-2015, CorreLog, Inc. All rights reserved. No part
Oracle Database 11g: SQL Tuning Workshop Release 2
Oracle University Contact Us: 1 800 005 453 Oracle Database 11g: SQL Tuning Workshop Release 2 Duration: 3 Days What you will learn This course assists database developers, DBAs, and SQL developers to
NETWORK PRINT MONITOR User Guide
NETWORK PRINT MONITOR User Guide Legal Notes Unauthorized reproduction of all or part of this guide is prohibited. The information in this guide is subject to change without notice. We cannot be held liable
DB2 for Linux, UNIX, and Windows Performance Tuning and Monitoring Workshop
DB2 for Linux, UNIX, and Windows Performance Tuning and Monitoring Workshop Duration: 4 Days What you will learn Learn how to tune for optimum performance the IBM DB2 9 for Linux, UNIX, and Windows relational
IBM Tivoli Composite Application Manager for Microsoft Applications: Microsoft Hyper-V Server Agent Version 6.3.1 Fix Pack 2.
IBM Tivoli Composite Application Manager for Microsoft Applications: Microsoft Hyper-V Server Agent Version 6.3.1 Fix Pack 2 Reference IBM Tivoli Composite Application Manager for Microsoft Applications:
Using SQL Server Management Studio
Using SQL Server Management Studio Microsoft SQL Server Management Studio 2005 is a graphical tool for database designer or programmer. With SQL Server Management Studio 2005 you can: Create databases
SPSS: Getting Started. For Windows
For Windows Updated: August 2012 Table of Contents Section 1: Overview... 3 1.1 Introduction to SPSS Tutorials... 3 1.2 Introduction to SPSS... 3 1.3 Overview of SPSS for Windows... 3 Section 2: Entering
Working with SQL Server Integration Services
SQL Server Integration Services (SSIS) is a set of tools that let you transfer data to and from SQL Server 2005. In this lab, you ll work with the SQL Server Business Intelligence Development Studio to
Quick Start SAP Sybase IQ 16.0
Quick Start SAP Sybase IQ 16.0 UNIX/Linux DOCUMENT ID: DC01687-01-1600-01 LAST REVISED: February 2013 Copyright 2013 by Sybase, Inc. All rights reserved. This publication pertains to Sybase software and
Writer Guide. Chapter 15 Using Forms in Writer
Writer Guide Chapter 15 Using Forms in Writer Copyright This document is Copyright 2005 2008 by its contributors as listed in the section titled Authors. You may distribute it and/or modify it under the
Abstract. For notes detailing the changes in each release, see the MySQL for Excel Release Notes. For legal information, see the Legal Notices.
MySQL for Excel Abstract This is the MySQL for Excel Reference Manual. It documents MySQL for Excel 1.3 through 1.3.6. Much of the documentation also applies to the previous 1.2 series. For notes detailing
Citrix EdgeSight for Load Testing User s Guide. Citrix EdgeSight for Load Testing 3.8
Citrix EdgeSight for Load Testing User s Guide Citrix EdgeSight for Load Testing 3.8 Copyright Use of the product documented in this guide is subject to your prior acceptance of the End User License Agreement.
Create a New Database in Access 2010
Create a New Database in Access 2010 Table of Contents OVERVIEW... 1 CREATING A DATABASE... 1 ADDING TO A DATABASE... 2 CREATE A DATABASE BY USING A TEMPLATE... 2 CREATE A DATABASE WITHOUT USING A TEMPLATE...
Oracle Insurance Agent Desktop User Guide. Version 8.0
Oracle Insurance Agent Desktop User Guide Version 8.0 October 2008 Oracle Insurance Agent Desktop User Guide Version 8.0 Part # E14963-01 Library E14885-01 & E148846-01 Formerly DV-SQV-00-002-1.0 October
TimeValue Software Due Date Tracking and Task Management Software
User s Guide TM TimeValue Software Due Date Tracking and Task Management Software File In Time Software User s Guide Copyright TimeValue Software, Inc. (a California Corporation) 1992-2010. All rights
IBM DB2: LUW Performance Tuning and Monitoring for Single and Multiple Partition DBs
coursemonster.com/au IBM DB2: LUW Performance Tuning and Monitoring for Single and Multiple Partition DBs View training dates» Overview Learn how to tune for optimum performance the IBM DB2 9 for Linux,
DB Audit Expert 3.1. Performance Auditing Add-on Version 1.1 for Microsoft SQL Server 2000 & 2005
DB Audit Expert 3.1 Performance Auditing Add-on Version 1.1 for Microsoft SQL Server 2000 & 2005 Supported database systems: Microsoft SQL Server 2000 Microsoft SQL Server 2005 Copyright SoftTree Technologies,
SQL Server An Overview
SQL Server An Overview SQL Server Microsoft SQL Server is designed to work effectively in a number of environments: As a two-tier or multi-tier client/server database system As a desktop database system
Oracle Enterprise Manager
Oracle Enterprise Manager System Monitoring Plug-in for Oracle TimesTen In-Memory Database Installation Guide Release 11.2.1 E13081-02 June 2009 This document was first written and published in November
DB2 for z/os: Utilities and Application Development
TRAINING & CONSULTING DB2 for z/os: Utilities and Application ABIS Training & Consulting www.abis.be [email protected] 2005, 2006 Document number: 0092_03b.fm 11 January 2006 Address comments concerning
Intellect Platform - Tables and Templates Basic Document Management System - A101
Intellect Platform - Tables and Templates Basic Document Management System - A101 Interneer, Inc. 4/12/2010 Created by Erika Keresztyen 2 Tables and Templates - A101 - Basic Document Management System
Instant SQL Programming
Instant SQL Programming Joe Celko Wrox Press Ltd. INSTANT Table of Contents Introduction 1 What Can SQL Do for Me? 2 Who Should Use This Book? 2 How To Use This Book 3 What You Should Know 3 Conventions
Domino Certification Authority and SSL Certificates
Domino Certification Authority and SSL Certificates Setup Domino as Certification Authority Process Client Certificate Requests Mike Bartlett ibm.com/redbooks Redpaper Redpaper International Technical
Introduction to Microsoft Access 2003
Introduction to Microsoft Access 2003 Zhi Liu School of Information Fall/2006 Introduction and Objectives Microsoft Access 2003 is a powerful, yet easy to learn, relational database application for Microsoft
Document Management User Guide
Document Management User Guide For the attention of SystmOne users: This document explains how to use the Document Management functionality once the setup has been completed. Contents Beginning to Scan...
Legal Notes. Regarding Trademarks. 2012 KYOCERA Document Solutions Inc.
Legal Notes Unauthorized reproduction of all or part of this guide is prohibited. The information in this guide is subject to change without notice. We cannot be held liable for any problems arising from
Netezza Workbench Documentation
Netezza Workbench Documentation Table of Contents Tour of the Work Bench... 2 Database Object Browser... 2 Edit Comments... 3 Script Database:... 3 Data Review Show Top 100... 4 Data Review Find Duplicates...
SonicWALL GMS Custom Reports
SonicWALL GMS Custom Reports Document Scope This document describes how to configure and use the SonicWALL GMS 6.0 Custom Reports feature. This document contains the following sections: Feature Overview
Advanced BIAR Participant Guide
State & Local Government Solutions Medicaid Information Technology System (MITS) Advanced BIAR Participant Guide October 28, 2010 HP Enterprise Services Suite 100 50 West Town Street Columbus, OH 43215
Microsoft Query, the helper application included with Microsoft Office, allows
3 RETRIEVING ISERIES DATA WITH MICROSOFT QUERY Microsoft Query, the helper application included with Microsoft Office, allows Office applications such as Word and Excel to read data from ODBC data sources.
Elisabetta Zodeiko 2/25/2012
PRINCETON UNIVERSITY Report Studio Introduction Elisabetta Zodeiko 2/25/2012 Report Studio Introduction pg. 1 Table of Contents 1. Report Studio Overview... 6 Course Overview... 7 Princeton Information
Advanced Query for Query Developers
for Developers This is a training guide to step you through the advanced functions of in NUFinancials. is an ad-hoc reporting tool that allows you to retrieve data that is stored in the NUFinancials application.
HelpSystems Web Server User Guide
HelpSystems Web Server User Guide Copyright Copyright HelpSystems, LLC. Robot is a division of HelpSystems. HelpSystems Web Server, OPAL, OPerator Assistance Language, Robot ALERT, Robot AUTOTUNE, Robot
CA Clarity Project & Portfolio Manager
CA Clarity Project & Portfolio Manager Using CA Clarity PPM with Open Workbench and Microsoft Project v12.1.0 This documentation and any related computer software help programs (hereinafter referred to
Business Objects Version 5 : Introduction
Business Objects Version 5 : Introduction Page 1 TABLE OF CONTENTS Introduction About Business Objects Changing Your Password Retrieving Pre-Defined Reports Formatting Your Report Using the Slice and Dice
ABAP SQL Monitor Implementation Guide and Best Practices
ABAP SQL Monitor Implementation Guide and Best Practices TABLE OF CONTENTS ABAP SQL Monitor - What is it and why do I need it?... 3 When is it available and what are the technical requirements?... 5 In
IBM Tivoli Monitoring Version 6.3 Fix Pack 2. Infrastructure Management Dashboards for Servers Reference
IBM Tivoli Monitoring Version 6.3 Fix Pack 2 Infrastructure Management Dashboards for Servers Reference IBM Tivoli Monitoring Version 6.3 Fix Pack 2 Infrastructure Management Dashboards for Servers Reference
IBM Tivoli Composite Application Manager for Microsoft Applications: Microsoft Internet Information Services Agent Version 6.3.1 Fix Pack 2.
IBM Tivoli Composite Application Manager for Microsoft Applications: Microsoft Internet Information Services Agent Version 6.3.1 Fix Pack 2 Reference IBM Tivoli Composite Application Manager for Microsoft
PeopleSoft Query Training
PeopleSoft Query Training Overview Guide Tanya Harris & Alfred Karam Publish Date - 3/16/2011 Chapter: Introduction Table of Contents Introduction... 4 Navigation of Queries... 4 Query Manager... 6 Query
Search help. More on Office.com: images templates
Page 1 of 14 Access 2010 Home > Access 2010 Help and How-to > Getting started Search help More on Office.com: images templates Access 2010: database tasks Here are some basic database tasks that you can
Chapter 4 Accessing Data
Chapter 4: Accessing Data 73 Chapter 4 Accessing Data The entire purpose of reporting is to make sense of data. Therefore, it is important to know how to access data locked away in the database. In this
Fixes for CrossTec ResQDesk
Fixes for CrossTec ResQDesk Fixes in CrossTec ResQDesk 5.00.0006 December 2, 2014 Resolved issue where the list of Operators on Category was not saving correctly when adding multiple Operators. Fixed issue
Teamstudio USER GUIDE
Teamstudio Software Engineering Tools for IBM Lotus Notes and Domino USER GUIDE Edition 30 Copyright Notice This User Guide documents the entire Teamstudio product suite, including: Teamstudio Analyzer
EVENT LOG MANAGEMENT...
Event Log Management EVENT LOG MANAGEMENT... 1 Overview... 1 Application Event Logs... 3 Security Event Logs... 3 System Event Logs... 3 Other Event Logs... 4 Windows Update Event Logs... 6 Syslog... 6
Oracle Database 11g: SQL Tuning Workshop
Oracle University Contact Us: + 38516306373 Oracle Database 11g: SQL Tuning Workshop Duration: 3 Days What you will learn This Oracle Database 11g: SQL Tuning Workshop Release 2 training assists database
