單個語句:
d:/>
db2expln -d wz20901 -u wzgladm wzglpass -t
-q "update mat_material set gatherplan_id=null where gatherplan_id =2005178 or gatherplan_id=32 "
licensed material - program property of ibm
ibm db2 universal database sql explain tool
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 = no
intra-partition parallel = no
sql path = "sysibm", "sysfun", "sysproc", "wzgladm"
sql statement:
update mat_material set gatherplan_id=null
where gatherplan_id =2005178 or gatherplan_id=32
section code page = 1386
estimated cost = 15083.518555
estimated cardinality = 940.719971
access table name = wzgladm.mat_material id = 5,27
| #columns = 1
| relation scan
| | prefetch: eligible
| lock intents
| | table: intent exclusive
| | row : exclusive
nested loop join
| data stream 1:
| | not piped
| | table constructor
| | | 2-row(s)
| | insert into temp table id = t1
| | | #columns = 0
| end of data stream 1
| access temp table id = t1
| | #columns = 0
| | relation scan
| | | prefetch: eligible
| | sargable predicate(s)
| | | #predicates = 1
update: table name = wzgladm.mat_material id = 5,27
end of section
d:/>
指令碼:
d:/>
db2expln -d wz20901 -u wzgladm wzglpass -t -z ; -f tmp.sql
licensed material - program property of ibm
ibm db2 universal database sql explain tool
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 = no
intra-partition parallel = no
sql path = "sysibm", "sysfun", "sysproc", "wzgladm"
sql statement:
select gatherplan_id
from mat_material
where gatherplan_id=2005178 or gatherplan_id=5 or gatherplan_id=3
section code page = 1386
estimated cost = 128.615417
estimated cardinality = 1411.079956
table constructor
| 3-row(s)
nested loop join
| access table name = wzgladm.mat_material id = 5,27
| | index scan: name = wzgladm.mat_idx_gplan_id id = 4
| | | regular index (not clustered)
| | | index columns:
| | | | 1: gatherplan_id (ascending)
| | #columns = 1
| | #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
| | sargable index predicate(s)
| | | | #columns = 1
return data completion
end of section
對於稍微複雜的sql,建議使用questcentral中的 sql turning 功能,比較直觀。
DB2檢視執行計畫的幾種方式
1.檢視儲存過程中sql的執行計畫 已知儲存過程名稱為procname1,模式名schema1,第一步,select specificname from syscat.proceduces where procname proname1 and procschema schema1 假設獲得spec...
MySQL使用explain檢視執行計畫
codergo mysql使用explain檢視執行計畫 explain可以顯示mysql對於語句的執行計畫,在5.6以及以後的版本中,除過select,其他比如insert,update和delete均可以使用explain檢視執行計畫。partitions關鍵字 顯示查詢將訪問的分割槽,如果你的...
db2mtrk db2記憶體使用檢視工具
當我們對db2進行監控檢查的時候,經常需要知道db2當前的記憶體使用情況。而db2mtrk工具就是乙個檢視當前記憶體使用情況的非常合適的工具。db2mtrk 顯示此命令的詳細語法 usage db2mtrk i d p m w v r interval count h 詳細語法 db2mtrk i ...