0% found this document useful (0 votes)
143 views

Performance Tuning Implementation

This document discusses performance tuning needed for DB2 table T2007. It identifies two SQL queries in program DJ00000 that perform full table scans on T2007 due to the lack of appropriate indexes. It recommends creating indexes X200702 and X200703 to support the WHERE clauses in the queries, which would improve performance by changing the scans to index scans. CPU metrics are provided showing the current transaction time for DJ00000, and the expected time and cost savings from adding the new indexes.

Uploaded by

Naveen Shetty
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
143 views

Performance Tuning Implementation

This document discusses performance tuning needed for DB2 table T2007. It identifies two SQL queries in program DJ00000 that perform full table scans on T2007 due to the lack of appropriate indexes. It recommends creating indexes X200702 and X200703 to support the WHERE clauses in the queries, which would improve performance by changing the scans to index scans. CPU metrics are provided showing the current transaction time for DJ00000, and the expected time and cost savings from adding the new indexes.

Uploaded by

Naveen Shetty
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

_______________________________________________________

DB2 Performance Tuning


T2007

Created by TCS
Date
Mar 18th, 2003
/var/www/apps/conversion/tmp/scratch_4/219387421.doc

DB2 PERFORMANCE TUNING.................................................................................................................1


T2007................................................................................................................................................................1
INTRODUCTION..............................................................................................................................................3
TARGET SQL CALLS.....................................................................................................................................3
LIST OF IMPACTED JOBS ...............................................................................................................................4
LIST OF IMPACTED TRANSACTIONS...............................................................................................................4
CPU METRICS...............................................................................................................................................5

Created by Sundaram Vadrevu

Introduction
T2007 - 2 indexes need to be defined for this table, the details of which are
given below.
Following programs have queries that access Table T2007 that either perform
a tablespace scan or non-matching index scan.
1.

DJ00000

Target SQL Calls


DJ00000 contains the following query which is performing a tablespace scan.
DECLARE GET-HISTORY-HS CURSOR FOR
SELECT REFD_REQUEST_DT ,
REFD_NO ,
REFD_LCL_CURR_AM ,
REFD_PAY_MTHD_CD ,
REFD_USER_ID_NO ,
REFD_PAY_DT ,
REFD_AUTHORISED_DT ,
REFD_APPR_TYPE_CD
FROM
V01_REFUND_HISTORY
WHERE CA_INDUSTRY_NO = : H
AND
CA_CURRENCY_CD = : H
AND
CA_BLOCK_DA = : H
AND
CA_CYCLE_NO = : H
AND
CA_DIGIT_NO = : H
ORDER BY REFD_REQUEST_DT DESC ,
REFD_NO DESC

There is only one index defined on T2007, which cannot be used by the above
query. So new index X200702 needs to be defined with the following columns
CA_INDUSTRY_NO
CA_CURRENCY_CD
CA_BLOCK_DA
CA_CYCLE_NO
CA_DIGIT_NO

Another query in DJ00000 which is performing a tablespace scan.


SELECT REFD_REQUEST_DT
, REFD_NO
, REFD_LCL_CURR_AM
, REFD_PAY_MTHD_CD
, REFD_USER_ID_NO
, REFD_PAY_DT
, REFD_AUTHORISED_DT
, REFD_APPR_TYPE_CD
FROM V01_REFUND_HISTORY
WHERE CORP_CTL_ACCT_KEY = :WW-CORP-KEY
ORDER BY REFD_REQUEST_DT DESC
, REFD_NO
DESC

Created by Sundaram Vadrevu

New index X200703 needs to be defined as follows which will then change the
tablespace scan to an matching index scan
CORP_CTL_ACCT_KEY

Existing Index
CE1.X200701
REFD_REQUEST_DT
REFD_NO

1
2

1 A
2 A

4 DATE
3 DECIMAL

New Indexes
CE1.X200702
CA_INDUSTRY_NO
CA_CURRENCY_CD
CA_BLOCK_DA
CA_CYCLE_NO
CA_DIGIT_NO

1
2
3
4
5

CHAR
CHAR
CHAR
CHAR
CHAR

2
2
5
1
1

CE1.X200703
CORP_CTL_ACCT_KEY

CHAR

10

List of impacted Jobs


None

List of impacted Transactions


SNO Program ID Region
1 DJ00000
1 CICPCEA1
2
3
4
5
6
7

Created by Sundaram Vadrevu

Transaction
ARAW
ARAX
ARCE
ARCP
AREE
AREF
AREX

CPU Metrics
The details of transaction DJ00000 for any given week are as follows:
Year Month Day Program Hours Min
103
3
10 DJ00000
0
6
103
3
11 DJ00000
0
5
103
3
12 DJ00000
0
6
103
3
13 DJ00000
0
6
103
3
14 DJ00000
0
4
103
3
15 DJ00000
0
0
103
3
16 DJ00000
0
0

Total transactions for a week


Total CPU time for that transaction/week
Average CPU/Transaction
No. of projected transactions/year
Expected reduction in time/transaction
Reduced transaction time/year
Savings in terms of dollars

Created by Sundaram Vadrevu

=
=
=
=
=
=
=
=
=
=

Secs No. Trans CPU


58.37
1646
21.96
1303
21.89
1711
16.34
1566
42.74
1187
21.39
73
13.35
50

Secs
418.37
321.96
381.89
376.34
282.74
21.39
13.35

7536
1816.04 seconds
0.240982 seconds
7536 * 52
391872
90%
391872 * 0.9 * 0.240982
84990.672 seconds
8.87 * 0.0212 * 84990.672
$ 16,982

You might also like