• No results found

Explaining EXPLAIN: DB2 10 Edition

N/A
N/A
Protected

Academic year: 2021

Share "Explaining EXPLAIN: DB2 10 Edition"

Copied!
108
0
0

Loading.... (view fulltext now)

Full text

(1)

Willie Favero

Dynamic Warehouse on z/OS Swat Team

DB2 SME

IBM Silicon Valley Laboratory

713-940-1132

[email protected]

Explaining EXPLAIN: DB2 10 Edition

(2)

Notices

This information was developed for products and services offered in the U.S.A.

Note to U.S. Government Users Restricted Rights — Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

IBM may not offer the products, services, or features discussed in this document in other countries. Consult your local IBM representative for information on the products and services currently available in your area. Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property right may be used instead. However, it is the user's responsibility to evaluate and verify the operation of any non-IBM product, program, or service.

IBM may have patents or pending patent applications covering subject matter described 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: IBM Director of Licensing, IBM Corporation, North Castle Drive Armonk, NY 10504-1785 U.S.A.

The following paragraph does not apply to the United Kingdom or any other country where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you.

This information could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice.

Any references in this information to non-IBM Web sites are provided for convenience only and do not in any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of the materials for this IBM product and use of those Web sites is at your own risk.

IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligation to you.

Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products.

This information contains examples of data and reports used in daily business operations. To illustrate them as completely as possible, the examples include the names of individuals, companies, brands, and products. All of these names are fictitious and any similarity to the names and addresses used by an actual business enterprise is entirely coincidental.

COPYRIGHT LICENSE:

This information contains sample application programs in source language, which illustrates programming techniques on various operating platforms. You may copy, modify, and distribute these sample programs in any form without payment to IBM, for the purposes of developing, using, marketing or distributing application programs conforming to the application programming interface for the operating platform for which the sample programs are written. These examples have not been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these programs. You may copy, modify, and distribute these sample programs in any form without payment to IBM for the purposes of developing, using, marketing, or distributing application programs conforming to IBM's application programming interfaces.

(3)

Trademarks

This presentation contains trade-marked IBM products and

technologies. Refer to the following Web site:

(4)

What is EXPLAIN?

EXPLAIN captures detailed information

about what could impact SQL

performance

or

-It gathers access path selection information

or

(5)

-EXPLAIN

was introduced in

DB2 Version 1.2

(6)

How is it Executed?

Can be dynamically prepared

Run as a static SQL statement

BIND/REBIND command option

Automatically at automatic REBIND

(7)

=

Access Path Selection

DB2 Catalog

Tables

DB2

DB2

Optimizer

Optimizer

z

CPU Cost

™

Traversing Rows and

Pages

™

Applying

Predicates(RDS vs.

DM)

™

Cost of sorting

"Least Cost Access Path"

z

I/O Cost

™

TS Scan vs. Index Scan

™

Index Scan

(MATCHCOLS,

CLUSTERRATION)

™

Workfile Scans

DSNDB07

Valid SQL

DB2 Internal

Cost Formulas

(8)

Statistics

RUNSTATS

Inline stats (REORG, LOAD, etc…)

And don’t forget about Stats Advisor

(9)

SQL EXPLAIN

EXPLAIN PLAN SET QUERY=nnn sql_statement

EXPLAIN STMTCACHE ALL

EXPLAIN STMTCACHE STMTID value

EXPLAIN STMTCACHE STMTTOKEN value

EXPLAIN PACKAGE

COLLECTION cccccc PACKAGE pppppp

Only works with DB2 9 packages and above.

(10)

Plan (Package) Management

„

DSNZPARM keyword PLANMGMT

‹

Need to specify BASIC or EXTENDED

z

BASIC

†

Access path information in repository

†

One access path retained

z

EXTENDED

†

Access path information in repository

†

Two access paths are retained; previous and original

‹

EXPLAIN PACKAGE keyword COPY specifies CURRENT,

PREVIOUS, or ORIGINAL should be used

z

HINT_USED contains which one

†

0 (current copy of package)

†

1 (previous copy of package)

(11)

QUERYNO

„

The column that “brings it all together”

‹

Of the 18 (DB2 9 has 16 or V8 has 15) EXPLAIN

tables, all but 1 has a QUERNO column

„

Populated by

‹

EXPLAIN SQL statement

EXPLAIN ALL

SET QUERYNO=nnn

<<<<< optional but should be used

(12)

QUERYNO

„

Populated by

‹

When EXPLAIN (YES) or

EXPLAIN (ONLY)

is

specified on the BIND/REBIND commands

z

QUERYNO is SQL statement number in pgm unless

†

Including QUERYNO keyword on SQL statement

SELECT ....

FROM ...

WHERE ...

WITH....

QUERYNO nnn

z

32767 statement limit (is that really a problem)

z

Could simplify using OPTHINTS

(13)

EXPLAIN(ONLY)

„

Populate EXPLAIN tables without creating or

replacing package

†

Available in Conversion Mode (CM)

‹

Same cost as bind

‹

Do not need the authority to run SQL in package to

EXPLAIN package

‹

Populate EXPLAIN tables even though

EXPLAIN(NO) was originally specified

‹

Test access path before replacing

z

Goes well with APREUSE(ERROR) or

APCOMPARE(ERROR)

APREUSE(ERROR) – Reuse previous access path. If any statement cannot be reused, bind ends.

APCOMPARE(ERROR) –compare old and new access for each statement. Terminate if different.

(14)

EXPLAIN Tip

„

DSNZPARM

‹

ABEXP keyword on the DSN6SPRM macro

Should EXPLAIN processing take place at automatic rebind?

z

YES – Default; perform EXPLAIN processing at auto rebind

†

You want to specify YES

z

NO - no EXPLAIN processing at auto rebind

‹

If package bound with EXPLAIN(NO), no EXPLAIN

processing takes place at rebind regardless of this

ZPARM’s setting.

‹

If the package was bound with EXPLAIN(YES) and

ABEXP is YES EXPLAIN processing still happens

during auto rebind even if the PLAN_TABLE doesn't

exist, there's just no output produced.

(15)

EXPLAIN Special Register

„

SET CURRENT EXPLAIN MODE =

z

NO - turns of capturing EXPLAIN information. This is the

default

z

YES - turns feature on causing EXPLAIN information to be

collected and plan tables to be updated.

z

EXPLAIN - this option is the same of YES. However, the

dynamic SQL statements are not executed

z

host_variable – must be CHAR or VARCHAR and can only

contain one of the above in uppercase and left justified

‹

Valid for eligible SQL only

z

SELECT, INSERT, and the searched form of UPDATE and

DELETE.

(16)

EXPLAIN Privilege

„

EXPLAIN is considered a “system privilege”

that allows you to grant select privileges without

granting execute on the SQL

‹

EXPLAIN specifying any of these keywords

z

ALL/PLAN,

z

STMTCACHE ALL,

z

STMTCACHE STMTID,

z

STMTCACHE STMTTOKEN,

z

MONITORED STMTS,

‹

Issue the SQL statements DESCRIBE TABLE and

PREPARE

‹

Specify BIND options EXPLAIN(ONLY) and

SQLERROR(CHECK),

‹

Explain dynamic SQL statements executing under

(17)

EXPLAIN Privilege

„

Syntax:

GRANT EXPLAIN TO …….

‹

Can grant on authorization ID, role, or to PUBLIC

‹

Can also specify WITH GRANT OPTION

(18)

Populates the PLAN_TABLE?

„

EXPLAIN’s will go here:

‹

PLAN_TABLE

z

Describes access path of SQL statement

z

Help better design SQL statements

z

Can be used for optimization hints

No

w

ai

t…

Tha

t d

oe

sn

’t

se

em

c

or

re

ct

?

Remember when everyone was trying

to get to the hidden EXPLAIN tables?

BTW,

(19)

Populate the PLAN_TABLE?

„

Explain’s output actually goes three places:

‹

PLAN_TABLE

z

Describes access path of SQL statement

z

Help better design SQL statements

z

Can give optimization hints

„

Added in DB2 Version 6

‹

DSN_STATEMNT_TABLE

z

Provides cost estimates

z

Cost in service units and in milliseconds

z

For dynamic and static SQL statements

‹

DSN_FUNCTION_TABLE

z

How DB2 resolves functions

z

One row for each function in an SQL statement

No,

S

til

l n

ot

cor

re

ct

(20)

Populate the PLAN_TABLE?

„

And then there were 15 :

‹

PLAN_TABLE, DSN_STATEMNT_TABLE,

DSN_FUNCTION_TABLE

„

Tables added in DB2 Version 8

‹

DSN_STATEMENT_CACHE_TABLE

z

If you have dynamic statement caching enabled, the

statement cache table contains the information about

any SQL statements in the statement cache as a

result of issuing the SQL statement EXPLAIN

STATEMENT CACHE ALL.

†

You may want to consider having IFCIDs 316,317,and 318

active for additional details.

‹

DSN_DETCOST_TABLE

z

The detailed cost table contains information about

detailed cost estimation of the mini-plans in a query.

No,

But

ge

tti

ng

c

lo

se

r…

(21)

Populate the PLAN_TABLE?

„

Tables used by EXPLAIN :

‹

DSN_FILTER_TABLE

z

The filter table contains information about how

predicates are used processing. during query

‹

DSN_PGRANGE_TABLE

z

The page range table, DSN_PGRANGE_TABLE,

contains information about qualified partitions for

all page range scans in a query.

‹

DSN_PGROUP_TABLE

z

The parallel group table, DSN_PGROUP_TABLE,

contains information about the parallel groups in a

query.

No,

But

ge

tti

ng

c

lo

se

r…

(22)

Populate the PLAN_TABLE?

„

Tables used by EXPLAIN :

‹

DSN_PREDICAT_TABLE

z

The predicate table, DSN_PREDICAT_TABLE,

contains information about all of the predicates in

a query.

‹

DSN_PTASK_TABLE

z

The parallel tasks table, DSN_PTASK_TABLE,

contains information about all of the parallel tasks

in a query.

‹

DSN_QUERY_TABLE

z

The query table contains information about a SQL

statement, and displays the statement before and

after query transformation.

z

Not populated for static SQL statements at BIND

or REBIND with EXPLAIN(YES)

No,

But

ge

tti

ng

c

lo

se

r…

(23)

Populate the PLAN_TABLE?

„

Tables used by EXPLAIN :

‹

DSN_SORTKEY_TABLE

z

The sort key table contains information about sort

keys for all of the sorts required by a query.

‹

DSN_SORT_TABLE

z

The sort table contains information about the sort

operations required by a query.

‹

DSN_STRUCT_TABLE

z

The structure table contains information about all

of the query blocks in a query.

‹

DSN_VIEWREF_TABLE

z

The view reference table contains information

about all of the views and materialized query

tables that are used to process a query.

No,

But

ge

tti

ng

c

lo

se

r…

(24)

Populate the PLAN_TABLE?

„

Tables used as input to EXPLAIN :

‹

DSN_VIRTUAL_INDEXES

z

The virtual indexes table enables optimization

tools to test the effect of creating and dropping

indexes on the performance of particular queries

†

Added in DB2 Version 8

‹

DSN_USERQUERY_TABLE

z

contains the information about optimization hints

†

Added in DB2 10

No,

But

ge

tti

ng

c

lo

se

r…

(25)

Populate the PLAN_TABLE?

„

Tables used by EXPLAIN as of DB2 10:

‹

DSN_KEYGTDIST_TABLE

z

This table contains non-uniform index expression statistic

that are obtained dynamically by the DB2 optimizer.

‹

DSN_COLDIST_TABLE

z

contains non-uniform column group statistics that are

obtained dynamically by DB2 from non-index leaf pages

‹

DSN_QUERYINFO_TABLE

z

Used for the IBM DB2 Analytics Accelerator

M

ay

be

n

(26)

DB2 10 Format

„

EBCDIC EXPLAIN tables deprecated in DB2 10

„

EXPLAIN tables in format before DB2 Version 8

disallowed

„

Migration job SDSNSAMP(DSNTIJPM) has queries to

discover non-compliant tables

„

DDL for EXPLAIN tables

‹

SDSNSAMP(DSNTESC) contains DDL to build all EXPLAIN

tables

‹

Data Studio (no-charge download)

‹

Optim Query Tuner (charge)

(27)

DSN_STATEMENT_CACHE_TABLE

(28)

Activate Dynamic Statement Cache

„

Activate Dynamic Statement Cache and make sure it’s

of adequate size

‹

To activate the Dynamic Statement Cache:

z

Install panel

†

CACHE DYNAMIC SQL field

z

or

z

DSNZPARM keyword

†

DSN6SPRM macro, keyword CACHEDYN

‹

Statement cache must of size to hold the entire workload

z

Install panel

†

EDM STATEMENT CACHE field

™

5000 to 1048576 KB allowed, default is 113386

™

The dynamic statement cache space is above the 2GB bar

z

or

z

DSNZPARM

(29)

Start

Trace

for Cache

„

Non-Data-Sharing -START TRACE command example

-STA TRACE(MON) CLASS(30) IFCID(316,317,318) DEST(SMF)

DSNW130I - MON TRACE STARTED, ASSIGNED TRACE NUMBER 04

DSN9022I - DSNWVCM1 '-STA TRACE' NORMAL COMPLETION

„

Data-Sharing –START TRACE command example

-STA TRACE(MON) CLASS(30) IFCID(316,317,318) DEST(SMF)

SCOPE(GROUP)

DSNW130I - MON TRACE STARTED, ASSIGNED TRACE NUMBER 04

DSN9022I - DSNWVCM1 '-STA TRACE' NORMAL COMPLETION

Note:

Do not use a Monitor Class 29 trace. It only starts IFCIDs 316 & 318 when IFCID 317 is also required.

(30)

Start Trace for Cache

„

IFCID 316

‹

First 60 bytes of SQL statement plus identifying information and

statistics (statement Id, authid, usage counters)

z

http://publib.boulder.ibm.com/infocenter/tivihelp/v15r1/index.jsp?topic=/co

m.ibm.omegamon.xe_db2.doc/ko2rrd20228.htm

„

IFCID 317

‹

Used in addition to IFCID 316 to obtain the full SQL statement text

z

http://publib.boulder.ibm.com/infocenter/tivihelp/v15r1/index.jsp?topic=/co

m.ibm.omegamon.xe_db2.doc/ko2rrd20228.htm

„

IFCID 318

‹

Contains no data and acts only as a switch for IFCID 316 to collect all

available information

z

Stopping and Starting IFCID 318 will reset stats and cause a new interval

to start

(31)

Capture Dynamic Statement Cache

„

Execute the EXPLAIN STMTCACHE ALL

z

Issuing the above SQL statements results in one row being

returned for each statement cached in the dynamic statement

cache to the DSN_STATEMENT_CACHE_TABLE table. Each

row returned contains identifying information about the cached

statement along with statistics reflecting that statements

execution. Statistics are returned ONLY when the IFCID 316 and

318 traces are active.

‹

This SQL statement can be executed using SPUFI, DSNTEP2,

DSNTEP4, or any number of programs that allow dynamically

prepared SQL statements.

‹

Ensure SCHEMA (SQLID if pre DB2 9) is set correct for the

EXPLAIN tables you are using for processing.

‹

Make sure you have the proper authorization to dump all the

SQL in the dynamic statement cache.

z

For example, running the EXPLAIN STMTCACHE ALL with

SYSADM authority will avoid this issue.

(32)

Stop Trace

„

Stop the trace ONLY after verifying

DSN_STATEMENT_CACHE_TABLE table appears to

be accurate

„

Stop trace

-STOP TRACE(MON) CLASS(30)

DSNW131I - STOP TRACE SUCCESSFUL FOR TRACE

NUMBER(S) 04

DSN9022I - DSNWVCM1 '-STO TRACE' NORMAL

COMPLETION

„

Verify trace has been successfully stopped

(33)

PLAN_TABLE, etc...

„

EXPLAIN Output tables:

‹

You are responsible for creating all EXPLAIN tables

‹

Ownership

z

For Dynamic - SQLID

z

For PLAN - Plan owner

z

For Package - Package owner

z

Can use ALIAS as of Version 8

‹

Data in tables MUST be interpreted

z

Must Understand Column Meaning and Codes

‹

EXPLAIN Won't Tell You Everything

z

Run Time Access Enhancements

z

Referential Integrity

(34)

The PLAN_TABLE

Is a table space scan bad?

And, is an index access good? It’s not all magic!!!!

COLUMN NAME

QUERYNO

QBLOCKNO

APPLNAME

PROGNAME

PLANNO

METHOD

CREATOR

TNAME

TABNO

ACCESSTYPE

MATCHCOLS

ACCESSCREATOR

ACCESSNAME

INDEXONLY

COLUMN NAME

QUERYNO

QBLOCKNO

APPLNAME

PROGNAME

PLANNO

METHOD

CREATOR

TNAME

TABNO

ACCESSTYPE

MATCHCOLS

ACCESSCREATOR

ACCESSNAME

INDEXONLY

Join Method

0, 1, 2, 3, 4

Join Method

0, 1, 2, 3, 4

Type of Access

Scan or Index

R, I, I1, IN, N, M, MX, MI, MU,

MH, A, DI, DU, DX, E, H, HN,

O, NR, P, R, RW, V, blank

Type of Access

Scan or Index

R, I, I1, IN, N, M, MX, MI, MU,

MH, A, DI, DU, DX, E, H, HN,

O, NR, P, R, RW, V, blank

Matching

Columns

from Index

Matching

Columns

from Index

25 Column Format (V2.1)

(35)

MATCHCOLS

C1=1

C2=2 ACCESSTYPE='I' and MATCHCOLS=3

C3>3

C4=4

C5=1

ACCESSTYPE='I' and MATCHCOLS=0

C1=1

C3>2 ACCESSTYPE='I' and MATCHCOLS=1

C4=3

(36)

COLUMN NAME

SORTN_UNIQ

SORTN_JOIN

SORTN_ORDERBY

SORTN_GROUPBY

SORTC_UNIQ

SORTC_JOIN

SORTC_ORDERBY

SORTC_GROUPBY

TSLOCKMODE

TIMESTAMP

REMARKS

Y=Yes - or - N=No

Was Sorting

Required

The PLAN_TABLE

Was Sorting

Required

IS, IX, S, U, X, SIX, N

or

-NS, NIS, NSS, SS

(37)

The PLAN_TABLE

COLUMN NAME

VERSION

COLLID

30 Column Format (V2.3)

COLUMN NAME

PREFETCH

COLUMN_FN_EVAL

MIXOPSEQ

28 Column Format (V2.2)

S, L, D, U, or Blank

R, S, or Blank

For Packages

(38)

COLUMN NAME

SORTC_PGROUP_ID

SORTN_PGROUP_ID

PARALLELISM_MODE

MERGE_JOIN_COLUMNS

CORRELATION_NAME

PAGE_RANGE

JOIN_TYPE

GROUP_MEMBER

IBM_SERVICE_DATA

I, C, X

F, L, S, P, blank

Y=Yes - or blank

43 Column Format (V4)

Parallelism

34 Column Format (V3)

COLUMN NAME

ACCESS_DEGREE

ACCESS_PGROUP_ID

JOIN_DEGREE

JOIN_PGROUP_ID

The PLAN_TABLE

(39)

COLUMN NAME

WHEN_OPTIMIZE

QBLOCK_TYPE

BIND_TIME

See List

COLUMN NAME

PARENT_QBLOCKNO

TABLE_TYPE

51 Column Format (V7)

COLUMN NAME

OPTHINT

HINT_USED

PRIMARY_ACCESSTYPE

49 Column Format (V6)

46 Column Format (V5)

F, Q, T, W, M, B, C, I, R, S

Blank, D, T

Hint identifier

Hint identifier

Blank, B, R

SELECT

INSERT

UPDATE

MERGE

DELETE

SELUPD

DELCUR

UPDCUR

CORSUB

TRUNCA

NCOSUB

TABLEX

TRIGGER

UNION

UNIONA

INTERS

INTERA

EXCEPT

EXCEPTA

PRUNED

The PLAN_TABLE

CREATE DDL in

Member DSNTESC

in DSNSAMP

(40)

The PLAN_TABLE

COLUMN NAME

„

TABLE_ENCODE

„

TABLE_SCCSID

„

TABLE_MCCSID

„

TABLE_DCCSID

„

ROUTINE_ID

58 Column Format (V8)

E – EBCDIC

A – ASCII

U – Unicode

M – multi CCSID sets

COLUMN NAME

„

CTEREF

„

STMTTOKEN

„

PARENT_PLANNO

(41)

The PLAN_TABLE

COLUMN NAME

„

BIND_EXPLAIN_ONLY

„

SECTNOI

„

EXPLAIN_TIME

„

MERGC

„

MERGN

64 Column Format (DB2 10)

Replaces TIMESTAMP and BIND_TIME

Y (yes), N (no)

“Y” if EXPLAIN(ONLY) specified on BIND/REBIND

Static SQL only

(42)

Plan_Table Access

Version 8 allows the use of an

ALIAS to access PLAN_TABLE

CREATE ALIAS WILLIE.PLAN_TABLE FOR

PRODUCTION.PLAN_TABLE

Willie runs query

(43)

Ordering PLAN_TABLE Data

„

PLAN_TABLE should be sorted by:

‹

EXPLAIN_TIME

z

When EXPLAIN information was captured

‹

QUERYNO

z

QUERYNO clause on EXPLAIN

z

QUERYNO clause on a DML statement

z

Line number from source

‹

QBLOCKNO

z

Query position in statement

†

1 is outer most query block

‹

PLANNO

z

Execution order of steps

‹

MIXOPSEQ

z

Step order for multiple index operations

(44)

„

Search for Plans:

‹

APPLNAME = the application plan name

„

Search for Packages:

‹

PROGNAME = the package name

‹

COLLID = the collection id

‹

VERSION = the version identifier

Which Rows Do You Want?

(45)

For Plans:

SELECT *

FROM YOUR_PLAN_TABLE

WHERE APPLNAME = ’application_plan_name'

ORDER BY

EXPLAIN_TIME, QUERYNO, QBLOCKNO, PLANNO, MIXOPSEQ;

For Packages:

SELECT *

FROM YOUR_PLAN_TABLE

WHERE PROGNAME =

’package_name'

AND COLLID =

’collection_id'

AND VERSION =

’version_identifier'

ORDER BY

EXPLAIN_TIME, QUERYNO, QBLOCKNO, PLANNO,MIXOPSEQ;

(46)

SELECT

A.BIND_TIME,',', A.QUERYNO,',',

A.QBLOCKNO,',', A.PLANNO,',',

METHOD AS MTHD,',',

SUBSTR(A.CREATOR,1,14) AS CREATOR,',',

SUBSTR(TNAME,1,14) AS TABLENAME,',',

BIGINT(C.CARDF) TCARDF, ',',

BIGINT(C.NPAGESF) TNPAGESF, ',',

C.PCTPAGES TPCTPAGES, ',', TABNO,',',

B.PROCMS, ',', B.PROCSU, ',', B.COST_CATEGORY, ',',

SUBSTR(B.REASON,1,25) AS REASON,',',

ACCESSTYPE AS ACCTYP,',',

MATCHCOLS AS MCOLS,',',

SUBSTR(ACCESSCREATOR,1,14) AS ACCSSCRTR,',',

SUBSTR(ACCESSNAME,1,14) AS ACCSSNM,',',

INDEXONLY AS INDXO,',',

SORTN_UNIQ AS SN_U,',',

SORTN_JOIN AS SN_J,',',

SORTN_ORDERBY AS SN_O,',',

SORTN_GROUPBY AS SN_G,',',

SORTC_UNIQ AS SC_U,',',

SORTC_JOIN AS SC_J,',',

SORTC_ORDERBY AS SC_O,',',

SORTC_GROUPBY AS SC_G,',',

TSLOCKMODE,',‘,

PREFETCH AS PFTCH,',',

COLUMN_FN_EVAL AS COL_FN_E,',',

MIXOPSEQ,',',

SUBSTR(A.VERSION,1,14) AS VERSION,',',

SUBSTR(A.COLLID,1,14) AS COLLID,',',

ACCESS_DEGREE AS ACC_D,',',

ACCESS_PGROUP_ID AS ACC_PGID,',',

JOIN_DEGREE AS JN_D,',',

JOIN_PGROUP_ID AS JN_PGID,',',

SORTC_PGROUP_ID AS SC_PGID,',',

SORTN_PGROUP_ID AS SN_PGID,',',

PARALLELISM_MODE AS P_ISM_MD,',',

MERGE_JOIN_COLS AS M_J_COL,',',

SUBSTR(CORRELATION_NAME,1,10) AS CORL_NM,',',

PAGE_RANGE,',',

JOIN_TYPE,',',

SUBSTR(A.GROUP_MEMBER,1,8) AS GRP_MBR,',',

WHEN_OPTIMIZE,',',

QBLOCK_TYPE,',',

PRIMARY_ACCESSTYPE AS PRI_ACCES_TYPE,',',

PARENT_QBLOCKNO,',',

PARENT_PLANNO,',',

TABLE_TYPE,',',

TABLE_ENCODE,',',

CTEREF,',',

(47)

MERGC,',',MERGN,',',

(CASE SUBSTR(HEX(SUBSTR(IBM_SERVICE_DATA,17,1)),1,1) WHEN 'A' THEN 10

WHEN 'B' THEN 11 WHEN 'C' THEN 12 WHEN 'D' THEN 13 WHEN 'E' THEN 14 WHEN 'F' THEN 15

ELSE INTEGER(SUBSTR(HEX(SUBSTR(IBM_SERVICE_DATA,17,1)),1,1))

END * POWER (16, 3) + CASE SUBSTR(HEX(SUBSTR(IBM_SERVICE_DATA,17,1)),2,1) WHEN 'A' THEN 10

WHEN 'B' THEN 11 WHEN 'C' THEN 12 WHEN 'D' THEN 13 WHEN 'E' THEN 14 WHEN 'F' THEN 15

ELSE INTEGER(SUBSTR(HEX(SUBSTR(IBM_SERVICE_DATA,17,1)),2,1))

END * POWER (16, 2) + CASE SUBSTR(HEX(SUBSTR(IBM_SERVICE_DATA,18,1)),1,1) WHEN 'A' THEN 10

WHEN 'B' THEN 11 WHEN 'C' THEN 12 WHEN 'D' THEN 13 WHEN 'E' THEN 14 WHEN 'F' THEN 15

ELSE INTEGER(SUBSTR(HEX(SUBSTR(IBM_SERVICE_DATA,18,1)),1,1))

END * POWER (16, 1) + CASE SUBSTR(HEX(SUBSTR(IBM_SERVICE_DATA,18,1)),2,1) WHEN 'A' THEN 10

WHEN 'B' THEN 11 WHEN 'C' THEN 12 WHEN 'D' THEN 13 WHEN 'E' THEN 14 WHEN 'F' THEN 15

ELSE INTEGER(SUBSTR(HEX(SUBSTR(IBM_SERVICE_DATA,18,1)),2,1)) END * POWER (16, 0)) AS NUMCP_EXP,',',

HEX(SUBSTR(IBM_SERVICE_DATA,23,1)) AS REASON,',', HEX(SUBSTR(IBM_SERVICE_DATA,25,2)) AS CPU,',', HEX(SUBSTR(IBM_SERVICE_DATA,69,4)) AS CPUSPEED,',', HEX(SUBSTR(IBM_SERVICE_DATA,13,4)) AS RIDPOOL,',', HEX(SUBSTR(IBM_SERVICE_DATA,9,4)) AS SORT_POOL_SIZE_HEX, SUBSTR(IBM_SERVICE_DATA,67,7) APAR,',', IBM_SERVICE_DATA FROM WILLIE.PLAN_TABLE A, DSN_STATEMNT_TABLE B, SYSIBM.SYSTABLES C WHERE C.DBNAME = 'BID1TB'

AND C.NAME = A.TNAME AND C.CREATOR = A.CREATOR AND C.TYPE = 'T'

AND A.QUERYNO = 91111

ORDER BY A.EXPLAIN_TIME, A.QUERYNO,A.QBLOCKNO, A.PLANNO, A.MIXOPSEQ ;

(48)

Using OPTHINT

„

Create and index on PLAN_TABLE

z

Key = QUERYNO, APPLNAME, PROGNAME, VERSION,

COLLID, OPTHINT

„

On installation panel DSNTIP4

‹

Set OPTIMIZATION HINTS to YES

„

Update Plan_Table

„

Set OPTHINT column to “

some_value

„

Tell DB2 to use the hint

‹

EXPLAIN(YES) and OPTHINT(’

some_value

)

or

‹

SET CURRENT OPTIMIZATION HINT ='

some_value

';

(49)

References

Please Visit My DB2 for z/OS Blog

(50)
(51)

DB2 SME

Data Warehousing for System z Swat Team

IBM Silicon Valley Laboratory

Willie Favero

(52)

Joins

„

METHOD

‹

0 - First table accessed

‹

1 - Nested Loop Join

‹

2 - Merge Scan Join

‹

3 - Sort

‹

4 - Hybrid Join

„

JOIN_TYPE

‹

F - Full Outer Join

‹

L - Left Outer Join

‹

S - Star Join

(53)

TABLE T1

TABLE T2

Composite

Composite

TABLE T3

OUTER TABLES

or

COMPOSITE TABLES

OUTER TABLES

or

COMPOSITE TABLES

INNER TABLES

or

NEW TABLES

INNER TABLES

or

NEW TABLES

Join Processing

(54)

Nested Loop Join

Outer Table

Inner Table

Small

Highly clustered

5

5

5

5

Small size

Low filter factor

TBNAME

ACCESS_TYPE

MATCHCOLS

METHOD = 0 - composite table – outer

METHOD = 1 – new table – inner table

SORTN_JOIN

(55)

Merge Scan Join

A

A

A

B

B

B

D

D

E

E

A

A

B

B

B

C

D

D

E

F

TBNAME

ACCESS_TYPE

MATCHCOLS

METHOD = 0 - composite table – outer

METHOD = 1 – new table – inner table

SORTN_JOIN

(56)

Column_name

QUERYNO

APPLNAME

PROGNAME

COLLID

GROUP_MEMBER

EXPLAIN_TIME

STMT_TYPE

COST_CATEGORY

PROCMS

PROCSU

REASON

DSN_STATEMNT_TABLE

SELECT

INSERT

UPDATE

DELETE

SELUPD

DELCUR

UPDCUR

Reason for using

Category B

A or B (next slide)

Same as Plan Table

Milli-seconds

Service Units

Cost estimates for static and dynamic

SELECT,INSERT,UPDATE

(57)

Cost Category

„

Category B includes

‹

Uses UDF’s

‹

Table has a trigger defined

‹

UPDATE, INSERT or DELETE

‹

WHERE predicate uses host variable,

parameter marker or special register

‹

Subselect contains a HAVING clause

‹

Cardinality stats are zero

‹

RI constraint with DELETE rule of CASCADE

or SET NULL

(58)

column name

QUERYNO

QBLOCKNO

APPLNAME

PROGNAME

COLLID

GROUP_MEMBER

EXPLAIN_TIME

SCHEMA_NAME

FUNCTION_NAME

SPEC_FUNC_NAME

FUNCTION_TYPE

VIEW_CREATOR

VIEW_NAME

PATH

FUNCTION_TEXT

DSN_FUNCTION_TABLE

Same as Plan Table

SU – Scalar

or

TU - Table

How DB2 resolves a function

Timestamp

If function is

referenced

in view definition

1

st

100 bytes of Function text

(59)

My Favorite Two ??? Terms

„

GETPAGE

‹

How DB2 satisfies your request for data from a

page

„

I/O

‹

What DB2 uses if page needed is NOT in the

(60)

The Cost of Doing Business

1.

Seek

2.

Rotational Delay

3.

Data Transfer

DB2

C

o

n

t

r

o

l

l

e

r

C

h

a

n

n

e

l

C

a

c

h

e

15-30 milliseconds per random read. Why?

OS/390

Services

(61)

How Much Prefetch?

4KB 1000+ buffers 32 pages (64)

8KB 500+ buffers 16 pages (32)

16KB 250+ buffers 8 pages (16)

32KB 100+ buffers 4 pages (8)

z

For an index scan that accesses 8 or more consecutive data pages, DB2

requests sequential prefetch at bind time. The index must have a cluster ratio of

80% or higher. Both data pages and index pages are prefetched.

(62)

Sequential Prefetch

Buffer Pool

Buffer Pool

Look aside

Sync

P

Async

P P P P P

P P P P P P

P P P P P P

P P P P P P

P P P P P P

P P P P P P

Async

P P P P P P

P P P P P P

P P P P P P

P P P P P P

P P P P P P

P P P P P P

X

X

X

(63)

Watch Out For…

„

Out of sequence index pages

„

Data rows on the wrong page due to

relocation (VarChar rows)

(64)

Segmented Table Space

Read

Simple Table Space

Read

QUERYNO TNAME ACCESSTYPE MATCHCOLS ACCESSNAME PRE

R

TAB1

1

0

S

(65)

List Prefetch

„

Access index pages

„

Process only RID

„

DB2 can apply index screening with multi column index

key

„

Sort RID in data page sequence

‹

Careful of high RID processing cost

‹

RID number restrictions

z

25% of table is accessed

z

RID’s take more than 50% of RID Pool

‹

Index order is not maintained

„

Fetch data pages in (skip) sequential order using

(66)

List-Prefetch

Root

Page

Non-Leaf

Page

Non-Leaf

Page

Non-Leaf

Page

Non-Leaf

Page

Non-Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Data

Page

Data

Page

Data

Page

Data

Page

Data

Page

Data

Page

RID SORT

(67)

5 of 8 pages read sequentially

Sequential Detection

Show up as an index access in Explain. But just watch!!!!!!!

z

First determine if the page is sequential

„

8 pages tracked within P/2 (P=32?)

(68)

Matching Index Scan

Root

Page

Non-Leaf

Page

Non-Leaf

Page

Non-Leaf

Page

Non-Leaf

Page

Non-Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Data

Page

Data

Page

Data

Page

Data

Page

Data

Page

Data

Page

INDEX ON T(C1,C2,C3)

SELECT * FROM T

WHERE C1 = 1 AND C2 = 5

AND C3 = 3 ;

EXPLAIN

ACCESSTYPE=I

MATCHCOLS>0

How many columns from primary

key were used for access?

Leaf

Page

(69)

Root

Page

Non-Leaf

Page

Non-Leaf

Page

Non-Leaf

Page

Non-Leaf

Page

Non-Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Data

Page

Data

Page

Data

Page

Data

Page

Data

Page

Data

Page

INDEX ON T(C1,C2,C3,C4)

SELECT * FROM T

WHERE C1 = 1 AND C4 = 5;

IN-List Index Scan - Special Case of Matching Index Scan

(70)

Root

Page

Non-Leaf

Page

Non-Leaf

Page

Non-Leaf

Page

Non-Leaf

Page

Non-Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Data

Page

Data

Page

Data

Page

Data

Page

Data

Page

Data

Page

(71)

Root

Page

Non-Leaf

Page

Non-Leaf

Page

Non-Leaf

Page

Non-Leaf

Page

Non-Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Data

Page

Data

Page

Data

Page

Data

Page

Data

Page

Data

Page

RID SORT

Prefetch Benefit To Data With Low Cluster Ratio

(72)

Rids For

Data Page Access

COCODE

AVGSAL

COLLEGE

SELECT * FROM SAMPLE

WHERE

( COCODE = ‘L05’ OR

AVGSAL < 80000 )

AND

COLLEGE = 03

(73)

QUERY

NO

TNAME

ACCESS

TYPE

IX

O

MATCH

COLS

PRE

COMP

UJOG

NEW

UJOG

MIXOP

SEQ

0002

0002

0002

0002

0002

0002

SAMPLE

SAMPLE

SAMPLE

SAMPLE

SAMPLE

SAMPLE

X1

X2

X3

ACCESS

NAME

M

MX

MX

MU

MX

MI

NNNN

NNNN

NNNN

NNNN

NNNN

NNNN

NNNN

NNNN

NNNN

NNNN

NNNN

NNNN

0

1

2

3

4

5

y

y

01

01

01

L

S

S

Indexes:

X1 on SAMPLE(COCODE)

X2 on SAMPLE(AVGSAL)

X3 on SAMPLE(COLLEGE)

MIA EXPLAIN

(74)

EXPLAIN PLAN SET QUERYNO = 1234 FOR

DELETE FROM SOME_TABLE

WHERE SOME_COL = ‘0001000’

Index XX1 on SOME_COL - CLUSTERRATION = 0%

QUERYNO TNAME ACCESSNAME ACCESSTYPE INDEXONLY

XX1

TAB1

1

I

Y

(75)

Other Index Access

„

One Fetch Access

‹

Best Possible Access.

‹

Only one row retrieved.

‹

ACCESSTYPE of 'I1'

„

Equal Unique Index

‹

Second only to one-fetch access.

‹

A fully matched unique index where all

matching predicates are equal.

„

Index Look-Aside

(always used)

(76)

Index Only

Data Pages

Index

Leaf Pages

Root Page

Non Leaf Pages

INDEX C1,C2,C3

SELECT C1,C2,C3

FROM

. . .

(77)

Index Look-Aside

Leaf Pages

Leaf Pages

Data Pages

Data Pages

Root Page

Root Page

Index

. . .

rows

Cached key

Non Leaf Pages

Non Leaf Pages

(78)

Root

Page

Non-Leaf

Page

Non-Leaf

Page

Non-Leaf

Page

Non-Leaf

Page

Non-Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Leaf

Page

Data

Page

Data

Page

Data

Page

Data

Page

Data

Page

Data

Page

Index Lookaside

(79)

Direct Row Access

„

What is it?

‹

No index, no table space scan

„

When might it be used?

‹

ROWID column must be present

‹

Stage 1 processing

‹

Search condition on SELECT, UPDATE, or DELETE

„

When will it Not be used?

‹

Row has moved

‹

Parallelism

‹

RID List processing

„

Should have index on ROWID column just in

(80)

QUERY

NO

TNAME

ACCESS

TYPE

IX

O

MATCH

COLS

PRE

COMP

UJOG

NEW

UJOG

PLAN

NO

SAMPLE

SAMPLE

SAMPLE

X1

ACCESS

NAME

R

R

I

NNNN

NNYN

NNNN

NNYN

NNNN

NNNN

NNNN

NNNN

NNNN

NNNN

1

2

1

2

1

N

S

S

S

EXPLAIN PLAN SET QUERYNO = 108 FOR

SELECT * FROM SAMPLE

ORDER BY SOME_COL

00

0108

0108

0108

0108

0108

X1 CLUSTERRATIO Increased - 75%, 85%, and 90%

(81)

EXPLAIN PLAN SET QUERYNO = 114 FOR

SELECT * FROM SAMPLE

WHERE SOME_COL LIKE ?

QUERY

NO

TNAME

ACCESS

TYPE

IX

O

MATCH

COLS

PRE

COMP

UJOG

NEW

UJOG

PLAN

NO

ACCESS

NAME

0114 TABBY XX3 I N 01 L NNNN NNNN 1

The ? acts like a

host variable

(82)

SELECT col1, col2, col3

FROM some_table

WHERE col2 > :host_var

DB2 will estimate

number of rows

returned based on

Catalog statistics

some_table

No index exist

Sorted Rows

Entire Answer Set

is Materialized

Application needs only 10 Rows

(83)

What Should Happen?

SELECT col1, col2, col3

FROM some_table

Where col2 > :host_var

DB2 will estimate

number of rows

returned based on

value supplied by

OPTIMZE Clause

some_table

First rows are returned

Quickly

However

The Entire Answer Could

Be Returned

Rows Returned

Application needs only 10 Rows

OPTIMIZE FOR 10 ROWS

What About

OPTIMZE FOR 1 ROW?

What about today?

(84)

EXPLAIN PLAN SET QUERY = 120

FOR

SELECT * FROM S_TAB

WHERE COL1 = ‘STUFF’

EXPLAIN PLAN SET QUERY = 121

FOR

SELECT * FROM S_TAB

WHERE COL1 = ‘STUFF’

OPTIMZE FOR 1 ROW

QUERY

NO

TNAME

ACCESS

TYPE

IX

O

MATCH

COLS

PRE

COMP

UJOG

NEW

UJOG

PLAN

NO

ACCESS

NAME

0120 S_TAB XX3 I 01 L NNNN NNNN 1

0121 S_TAB XX3 I N 01

NNNN NNNN 1

Index is not on COL1

(85)

EXPLAIN PLAN SET QUERY = 122

FOR

SELECT * FROM S_TAB

ORDER BY LAST_COL

EXPLAIN PLAN SET QUERY = 123

FOR

SELECT * FROM S_TAB

ORDER BY LAST_COL

OPTIMZE FOR 1 ROW

QUERY

NO

TNAME

ACCESS

TYPE

IX

O

MATCH

COLS

PRE

COMP

UJOG

NEW

UJOG

PLAN

NO

ACCESS

NAME

0122 S_TAB XX3 I 01 L NNNN NNNN 1

0123 S_TAB XX3 I N 01 L NNNN NNNN 1

0122

NNYN NNNN 2

OPTIMZE FOR....

(86)

FETCH FIRST n ROWS ONLY

(87)

0-100

101-200

201-300

301-400

401-500

0-100

101-200

201-300

301-400

401-500

V4.1

V5.1 and above

Read

Read

Partition Scan Change

PAGE_RANGE =

PAGE_RANGE =

Y

Y

---

---

Partition Scan

Partition Scan

Prior to V4

(88)

METHOD

TNAME

ACCESS_DEGREE

ACCESS_PGROUP_ID

JOIN_DEGREE

JOIN_PGROUP_ID

TAB1

0

3

1

Buffer Pool

Table Space Scan

Degree

and

Access Parallel Group

(89)

TAB1

TAB2

METHOD

TNAME

ACCESS_DEGREE

ACCESS_PGROUP_ID

JOIN_DEGREE

JOIN_PGROUP_ID

TAB1

TAB2

0

1

3

3

1

3

1

1

(90)

METHOD

TNAME

ACCESS_DEGREE

ACCESS_PGROUP_ID

JOIN_DEGREE

JOIN_PGROUP_ID

TAB1

TAB2

0

2

2

3

1

2

3

2

S

o

r

t

DB2 Sort

Facility

Physically

Repartitioned

TAB1

TAB2

(91)

Table Space Scan

METHOD

TNAME

ACCESS_DEGREE

ACCESS_PGROUP_ID

JOIN_DEGREE

JOIN_PGROUP_ID

TAB1

0

0

1

Host Variables

(92)

Choosing Parallelism

DEGREE Option on

BIND

Package/Plan

(93)

Accounting Trace

• ACE Address

• Originating ACE Address

• Number of parallel task created

• CP time

• Getpages

• Sequential prefetch

• ACE Address

• Originating ACE Address

• Number of parallel task created

• CP time

• Getpages

• Sequential prefetch

Originating

Task

One record

for each

Parallel

Task

The Numbers

(94)

Accounting Trace

• Member name

• ACE Address

• Query originating member

• Originating ACE Address

• Number of parallel task created

• LUWID

• Member name

• ACE Address

• Query originating member

• Originating ACE Address

• Number of parallel task created

• LUWID

Originating Task

One record

for each

Parallel

Task

+ More...

+ More...

On different members

(95)

• Pgm name, statement number, and QBLOCKNO

• Parallel group number

• Planned bind, planned run, and actual degrees

• Reason for runtime degree

• Parallel Mode

• Low/High page/keey range for logical partitions

• Status

• Pgm name, statement number, and QBLOCKNO

• Parallel group number

• Planned bind, planned run, and actual degrees

• Reason for runtime degree

• Parallel Mode

• Low/High page/keey range for logical partitions

• Status

IFCID 221 -

Issued for each parallel group

Repeats for each logical partition

Repeats for each logical partition

(96)

• Pipe creation/termination times

• Rows processed

• Subpipe creation/termination times

• Rows processed per subpipe

• Pipe creation/termination times

• Rows processed

• Subpipe creation/termination times

• Rows processed per subpipe

IFCID 222 -

Issued for each parallel group

Even More Numbers

Repeats for each subpipe

(97)

• Group creation/termination times

• Parallel task creation/termination times

• CP seconds

• DB2 member and service units added in Version 5

• Group creation/termination times

• Parallel task creation/termination times

• CP seconds

• DB2 member and service units added in Version 5

IFCID 231 -

Issued for each parallel group -

not used for I/O parallelism

All three trace records are available from a

Class 8 Performance Trace

Repeats for each parallel task

Repeats for each parallel task

(98)

Some Trace Information

(for the daring!)

„

Performance Class 8

‹

IFCID 221 - MVS Enclave services not available

‹

IFCID 222 - Additional Subpipe information

‹

IFCID 231 - Parallel group number and task create and

terminate times

„

Statistics Class 1

‹

IFCID 0002 - Extended fields to include CPU parallelism

„

Accounting Class 1

‹

IFCID 0003 - Added number of parallel task

„

Performance Class 3

(99)

QUERY

NO

TNAME

ACCESS

TYPE

IX

O

MATCH

COLS

PRE

COMP

UJOG

NEW

UJOG

PLAN

NO

ACCESS

NAME

EXPLAIN PLAN SET QUERY = 106

FOR

SELECT * FROM S_TAB

ORDER BY LAST_COL

0106 S_TAB R

S NNNN NNNN 1

0106 S_TAB XX4 I N 00 S NNNN NNNN 1

0106

NNYN NNNN 2

EXPLAIN PLAN SET QUERY = 107

FOR

SELECT * FROM S_TAB

ORDER BY LAST_COL DESC

XX4 has CLUSTERRATION = 99%

(100)

QUERY

NO

TNAME

ACCESS

TYPE

IX

O

MATCH

COLS

PRE

COMP

UJOG

NEW

UJOG

PLAN

NO

ACCESS

NAME

EXPLAIN PLAN SET QUERY = 124

FOR

SELECT * FROM S_TAB

WHERE SEX = ‘M’

0124 S_TAB R

S NNNN NNNN 1

0126 S_TAB R

S NNNN NNNN 1

0125 S_TAB XX6 I N 01 L NNNN NNNN 1

EXPLAIN PLAN SET QUERY = 125

FOR

SELECT * FROM S_TAB

WHERE SEX = ‘M’ AND

B_COL > 5000

WHERE SEX = ‘M’ OR

B_COL > 5000

QUERYNO=0126

(101)

QUERY

NO

TNAME

ACCESS

TYPE

IX

O

MATCH

COLS

PRE

COMP

UJOG

NEW

UJOG

TS

LOCK

MODE

ACCESS

NAME

EXPLAIN PLAN SET QUERY = 124

FOR

SELECT * FROM S_TAB

WHERE SEX = ‘M’

0124 S_TAB R

S NNNN NNNN S

(102)

Make it Work Correctly

„

Catalog Statistics

‹

Must reflect production values

‹

Watch out for Default Values

„

Dynamic vs Static Explain

‹

Uses "?" instead of actual value

‹

“?” always matches

(103)

If EXPLAIN YES, Then Look!

„

Validate Access Paths Selected

‹

Identify Ineffective SQL

z

Index verses non-index access

z

Stage 1 vs Stage 2 Predicates

‹

At Development Time

z

Examine output form each SQL statement

z

Check out all SQL in plan for Unit Test

‹

At Maintenance Time

z

Need history EXPLAIN output

z

Examine every statement

References

Related documents

In the option ‘Electronics and Integrated Circuits’, you will learn how to design and create electronic and integrated circuits for a wide range of electronic systems

21 Three different methods have been used for femoral resection: (1) cutting of the femur parallel to the posterior condylar axis (a technique based on restoring

However, at higher albendazole doses, sufficient is absorbed and metabolised to the active sulphoxide metabolite, to have a therapeutic effect against tissue parasites..

According to the results, the pollen source affected hulls and kernels in Siirt cultivar, and it affected all three parts of nuts in Ohadi cultivar; while it affected only kernel

Qualitative parameters (leaf color, leaf shape, leaf tip, leaf middle, leaf base, leaf margin, leaf surface texture, and leaf venation) were analyzed using the descriptive

In the List of Objects area, clicking a leaf object, such as a user or group, displays a page intended to view or modify object properties; clicking a container object, such as

Secondly, although subsidiary willingness to share LMI with MNCs’, trust between subsidiaries and MNCs, and organizational distance were found to affect RKT in

The inefficiency function shows that, the coefficients for the level of education, age of the farmers, extension contact were negatively related to technical inefficiency