idkjyold#/db2aix/iprocess$db2expln -d sample -q "update tab_1 a set value1 = (select value1 from tab_2 b where a.bm=b.bm)" -g -tDB2 Universal Database Version 9.5, 5622-044 (c) Copyright IBM Corp. 1991, 2007Licensed Material - Program Prop...
显示全部idkjyold#/db2aix/iprocess$db2expln -d sample -q "update tab_1 a set value1 = (select value1 from tab_2 b where a.bm=b.bm)" -g -t
DB2 Universal Database Version 9.5, 5622-044 (c) Copyright IBM Corp. 1991, 2007
Licensed Material - Program Property of IBM
IBM DB2 Universal Database SQL and XQUERY Explain Tool
DB2 Universal Database Version 9.5, 5622-044 (c) Copyright IBM Corp. 1991, 2007
Licensed Material - Program Property of IBM
IBM DB2 Universal Database SQL and XQUERY Explain Tool
******************** DYNAMIC ***************************************
==================== STATEMENT ==========================================
Isolation Level = Cursor Stability
Blocking = Block Unambiguous Cursors
Query Optimization Class = 5
Partition Parallel = No
Intra-Partition Parallel = No
SQL Path = "SYSIBM", "SYSFUN", "SYSPROC", "SYSIBMADM",
"IPROCESS"
Statement:
update tab_1 a set value1 =
(select value1
from tab_2 b
where a.bm=b.bm)
Section Code Page = 1208
Estimated Cost = 37.868073
Estimated Cardinality = 3.000000
Access Table Name = IPROCESS.TAB_1 ID = 3,65
| #Columns = 1
| Relation Scan
| | Prefetch: Eligible
| Lock Intents
| | Table: Intent Exclusive
| | Row : Exclusive
Nested Loop Join
| Piped Inner
| Access Table Name = IPROCESS.TAB_2 ID = 3,66
| | #Columns = 1
| | Evaluate Block/Data Predicates Before Locking Committed Row
| | Relation Scan
| | | Prefetch: Eligible
| | Lock Intents
| | | Table: Intent Share
| | | Row : Next Key Share
| | Sargable Predicate(s)
| | | #Predicates = 1
Update: Table Name = IPROCESS.TAB_1 ID = 3,65
End of section
Optimizer Plan:
Rows
Operator
(ID)
Cost
3
UPDATE
( 2)
37.8681
/ \
3 3
NLJOIN Table:
( 3) IPROCESS
15.1715 TAB_1
/ \
3 0.04
TBSCAN TBSCAN
( 4) ( 5)
7.58444 7.58316
| |
3 1
Table: Table:
IPROCESS IPROCESS
TAB_1 TAB_2
我的推断应该是对的:-)
收起