Re: Performance issue in a partitioned database I have attached the 'db2expln' output below. Was unable to get db2exfmt
working.
Just confirmed the insert strategy from the developers - they try to
insert first and if it fails, then they update it.
Actually, this table had a self referencing constraint which ate up a
major chunk of the exectution time (figured this from the Visual Explain).
Once this self referential constraint was removed, it ran fine. Is there
anything different that needs to be done to deal with self referential
constraints??
DB2 Universal Database Version 8.1, 5622-044 (c) Copyright IBM Corp. 1991,
2002
Licensed Material - Program Property of IBM
IBM DB2 Universal Database SQL Explain Tool
DB2 Universal Database Version 8.1, 5622-044 (c) Copyright IBM Corp. 1991,
2002
Licensed Material - Program Property of IBM
IBM DB2 Universal Database SQL Explain Tool
******************** DYNAMIC ***************************************
==================== STATEMENT ==========================================
Isolation Level = Cursor Stability
Blocking = Block Unambiguous Cursors
Query Optimization Class = 5
Partition Parallel = Yes
Intra-Partition Parallel = No
SQL Path = "SYSIBM", "SYSFUN", "SYSPROC",
"EDWSAS"
SQL Statement:
INSERT INTO EDWUTST.TCN_CLIENT(CLN_HI_ID, CLN_NK_ID, CLN_STRT_DT,
CLN_END_DT, SRCE_SYS_NK_ID, BR_NK_ID, CLN_NUM,
PARENT_CLN_NK_ID, CLN_TYP, CLN_SECUR_NUM, BR_HI_ID,
PARENT_CLN_HI_ID, TRAN_TS, TRAN_USR_ID, LOAD_ID, COMP_CDE,
LOCN_ADDR_NK_ID, MAIL_ADDR_NK_ID, LOCN_ADDR_HI_ID,
MAIL_ADDR_HI_ID, LAST_UPDT_LOAD_ID)VALUES (?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Section Code Page = 1252
Estimated Cost = 77.245018
Estimated Cardinality = 0.333333
Coordinator Subsection - Main Processing:
Distribute Subsection #3
| Broadcast to Node List
| | Nodes = 1, 2, 3
Distribute Subsection #4
| Broadcast to Node List
| | Nodes = 1, 2, 3
Distribute Subsection #2
| Directed by Hash
| | #Columns = 1
| | Partition Map ID = 3, Nodegroup = PDPG, #Nodes = 1
Distribute Subsection #1
| Directed to Single Node
| | Node Number = 0
Subsection #1:
Access Table Queue ID = q1 #Columns = 0
Left Outer Nested Loop Join
| Access Table Name = EDWUTST.TGE_SOURCE_SYSTEM ID = 7,29
| | Index Scan: Name = EDWUTST.XGE_SOURCE_SYSTEM ID = 1
| | | Regular Index (Not Clustered)
| | | Index Columns:
| | | | 1: SRCE_SYS_NK_ID (Ascending)
| | #Columns = 1
| | Single Record
| | Fully Qualified Unique Key
| | #Key Columns = 1
| | | Start Key: Inclusive Value
| | | | | 1: ?
| | | Stop Key: Inclusive Value
| | | | | 1: ?
| | Index-Only Access
| | Index Prefetch: None
| | Lock Intents
| | | Table: Intent Share
| | | Row : Next Key Share
Residual Predicate(s)
| #Predicates = 3
Left Outer Nested Loop Join
| Access Table Name = EDWUTST.TGE_COMPANY ID = 7,23
| | Index Scan: Name = EDWUTST.XGE_COMPANY ID = 1
| | | Regular Index (Not Clustered)
| | | Index Columns:
| | | | 1: COMP_CDE (Ascending)
| | #Columns = 1
| | Single Record
| | Fully Qualified Unique Key
| | #Key Columns = 1
| | | Start Key: Inclusive Value
| | | | | 1: ?
| | | Stop Key: Inclusive Value
| | | | | 1: ?
| | Index-Only Access
| | Index Prefetch: None
| | Lock Intents
| | | Table: Intent Share
| | | Row : Next Key Share
Residual Predicate(s)
| #Predicates = 3
Left Outer Nested Loop Join
| Access Table Name = EDWUTST.TGE_BRANCH ID = 7,21
| | Index Scan: Name = EDWUTST.XGE_BRANCH ID = 1
| | | Regular Index (Not Clustered)
| | | Index Columns:
| | | | 1: BR_HI_ID (Ascending)
| | #Columns = 1
| | Single Record
| | Fully Qualified Unique Key
| | #Key Columns = 1
| | | Start Key: Inclusive Value
| | | | | 1: ?
| | | Stop Key: Inclusive Value
| | | | | 1: ?
| | Index-Only Access
| | Index Prefetch: None
| | Lock Intents
| | | Table: Intent Share
| | | Row : Next Key Share
Residual Predicate(s)
| #Predicates = 3
Subsection #2:
Insert: Table Name = EDWUTST.TCN_CLIENT ID = 3,14
Left Outer Nested Loop Join
| Piped Inner
| Access Table Queue ID = q2 #Columns = 1
Residual Predicate(s)
| #Predicates = 3
Left Outer Nested Loop Join
| Piped Inner
| Access Table Queue ID = q3 #Columns = 1
Residual Predicate(s)
| #Predicates = 3
Insert Into Asynchronous Table Queue ID = q1
| Broadcast to All Nodes of Subsection 1
| Rows Can Overflow to Temporary Table
Subsection #3:
Access Table Name = EDWUTST.TAP_ADDRESS ID = 3,21
| Index Scan: Name = EDWUTST.XAP_ADDRESS ID = 1
| | Regular Index (Not Clustered)
| | Index Columns:
| | | 1: ADDR_HI_ID (Ascending)
| #Columns = 1
| Fully Qualified Unique Key
| #Key Columns = 1
| | Start Key: Inclusive Value
| | | | 1: ?
| | Stop Key: Inclusive Value
| | | | 1: ?
| Index-Only Access
| Index Prefetch: None
| Isolation Level: Read Stability
| Lock Intents
| | Table: Intent Share
| | Row : Next Key Share
| Sargable Index Predicate(s)
| | Insert Into Asynchronous Table Queue ID = q2
| | | Hash to Specific Node
| | | Rows Can Overflow to Temporary Tables
Insert Into Asynchronous Table Queue Completion ID = q2
Subsection #4:
Access Table Name = EDWUTST.TAP_ADDRESS ID = 3,21
| Index Scan: Name = EDWUTST.XAP_ADDRESS ID = 1
| | Regular Index (Not Clustered)
| | Index Columns:
| | | 1: ADDR_HI_ID (Ascending)
| #Columns = 1
| Fully Qualified Unique Key
| #Key Columns = 1
| | Start Key: Inclusive Value
| | | | 1: ?
| | Stop Key: Inclusive Value
| | | | 1: ?
| Index-Only Access
| Index Prefetch: None
| Isolation Level: Read Stability
| Lock Intents
| | Table: Intent Share
| | Row : Next Key Share
| Sargable Index Predicate(s)
| | Insert Into Asynchronous Table Queue ID = q3
| | | Hash to Specific Node
| | | Rows Can Overflow to Temporary Tables
Insert Into Asynchronous Table Queue Completion ID = q3
End of section |