DB2執行計劃(1)
檢視執行計劃的兩種方式:
1.
db2 -tvf $DB2HOME/sqllib/misc/EXPLAIN.DDL
db2 set current explain mode explain
db2 "statements"
db2 set current explain mode no
db2exfmt -d bidw -u username password -w -l -s % -n % -o explain.out
cat explain.out
2.
db2expln -d bidw -u username password -g -t -q "statement";
eg:
db2expln -d bidw -u username password -g -t -q " statemens"
===============================
db2exfmt o Table Operators
db2exfmt TBSCAN - Table Scan
db2exfmt IXSCAN - Index Scan
db2exfmt FETCH - Fetch from Table
db2exfmt
db2exfmt o Joins
db2exfmt MSJOIN - Merge Scan Join
db2exfmt NLJOIN - Nested Loop Join
db2exfmt HSJOIN - Hash Join
db2exfmt
db2exfmt o Aggregation
db2exfmt GRPBY - Group By
db2exfmt SUM - Sum
db2exfmt AVG - Average
db2exfmt MIN - Minimum
db2exfmt MAX - Maximun
db2exfmt etc.
db2exfmt
db2exfmt o Temp / Sort
db2exfmt TEMP - Insert into temp table
db2exfmt SORT - Sort
db2exfmt
db2exfmt o Special Operations
db2exfmt IXAND - Index ANDing
db2exfmt RIDSCA - Index ORing or List Prefetch
db2exfmt IXA - Star Schema Bitmap Indexing
db2exfmt BTQ - Broadcast Table Queue
db2exfmt DTQ - Directed Table Queue
db2exfmt MBTQ - Merge Broadcast Table Queue
db2exfmt MDTQ - Merge Directed Table Queue
db2exfmt LTQ - Local Table Queue, for Intra-partition parallelism
+-------------------------------+-----------------------+-----------------------+
| Join Strategy | Inner Table | Outer Table |
+-------------------------------+-----------------------+-----------------------+
| Collocated Join /*配置地*/ | Temporary Table | Temporary Table |
+-------------------------------+-----------------------+-----------------------+
| Directed Inner Join | Temporary Table | Hashed Table Queue |
| Directed Outer Join | Hashed Table Queue | Temporary Table |
| Directed Inner and Outer Join | Hashed Table Queue | Hashed Table Queue |
+-------------------------------+-----------------------+-----------------------+
| Broadcast Inner Join | Temporary Table | Broadcast Table Queue |
| Boradcast Outer Join | Broadcast Table Queue | Temporary Table |
+-------------------------------+-----------------------+-----------------------+
附:
BTQ Broadcast Table Queue broadcasts data to several partitions.
DELETE Deletes rows from a table.
DTQ Directed Table Queue transfers data to a specific partition.
EISCAN Scans a user-defined index to produce a reduced stream of rows.
FETCH Fetches columns from a table using specific record identifier.
FILTER Represents the application of residual predicates.
GRPBY Groups rows by common values of desig-nated columns or functions.
HSJOIN Represents a hash join, where two or more tables are hashed on join columns.
INSERT Inserts rows into a table.
IXAND ANDs together the row identifiers (RIDs) from two or more index scans.
IXSCAN Scans an index of a table with optional start/stop conditions, producing an ordered stream of rows.
LTQ Local Table Queue. Transfers data between local agents.
LMTQ Local Merge Table Queue. Merges data transferred between local agents.
MBTQ Merging Broadcast Table Queue.
MDTQ Merging Directed Table queue.
MSJOIN Represents a merge join, where both outer and inner tables must be in join-predicate order.
NLJOIN Represents a nested loop join that accesses an inner table once for each row of the outer table.
RETURN Represents the return of data from the query to the user.
RIDSCAN Scans a list of row identifiers (RIDs) obtained from one or more indexes.
RPD For nonrelational wrappers, it shows the simulated SQL operation that the nonrelational wrapper will be asked to perform.
SHIP Retrieves data from a remote database source. Used in federated systems.
SORT Sorts rows in the order of specified columns, and optionally eliminates duplicate entries.
TBSCAN Retrieves rows by reading all required data directly from the data pages.
TEMP Stores data in a temporary table to be read back out (possibly multiple times).
TQUEUE Transfers table data between agents.
UNION Concatenates streams of rows from multiple tables.
UNIQUE Eliminates rows with duplicate values, for specified columns.
UPDATE Updates rows in a table.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23937368/viewspace-1048229/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- db2 執行計劃DB2
- DB2執行計劃分析DB2
- 執行計劃-1:獲取執行計劃
- db2檢視執行計劃DB2
- SQL 執行計劃案例1SQL
- 執行計劃
- 交流(1)-- 執行計劃錯誤問題
- 分析執行計劃優化SQLORACLE的執行計劃(轉)優化SQLOracle
- oracle sqlprofile 固定執行計劃,並遷移執行計劃OracleSQL
- 【sql調優之執行計劃】獲取執行計劃SQL
- SYBASE執行計劃
- MySQL 執行計劃MySql
- MySQL執行計劃MySql
- sql 執行計劃SQL
- ORACLE執行計劃Oracle
- 【執行計劃】Oracle獲取執行計劃的幾種方法Oracle
- 【Oracle】-【索引-HINT,執行計劃】-帶HINT的索引執行計劃Oracle索引
- 分析執行計劃最佳化SQLORACLE的執行計劃(轉)SQLOracle
- 【PG執行計劃】Postgresql資料庫執行計劃統計資訊簡述SQL資料庫
- oracle 固定執行計劃Oracle
- Oracle sql執行計劃OracleSQL
- explain執行計劃分析AI
- mysql執行計劃explainMySqlAI
- mysql explain 執行計劃MySqlAI
- MySQL執行計劃解析MySql
- 分割槽 執行計劃
- 執行計劃繫結
- SQL Server執行計劃SQLServer
- 執行計劃詳解
- 啟動執行計劃
- SQL的執行計劃SQL
- FAST DUAL執行計劃?AST
- 執行計劃的理解.
- min ? max ? 執行計劃?
- 檢視執行計劃
- SQL執行計劃分析SQL
- 如何看懂執行計劃!
- 閱讀執行計劃