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.

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23937368/viewspace-1048229/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/23937368/viewspace-1048229/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
提供的源码资源涵盖了安卓应用、小程序、Python应用和Java应用等多个领域,每个领域都包含了丰富的实例和项目。这些源码都是基于各自平台的最新技术和标准编写,确保了在对应环境下能够无缝运行。同时,源码中配备了详细的注释和文档,帮助用户快速理解代码结构和实现逻辑。 适用人群: 这些源码资源特别适合大学生群体。无论你是计算机相关专业的学生,还是对其他领域编程感兴趣的学生,这些资源都能为你提供宝贵的学习和实践机会。通过学习和运行这些源码,你可以掌握各平台开发的基础知识,提升编程能力和项目实战经验。 使用场景及目标: 在学习阶段,你可以利用这些源码资源进行课程实践、课外项目或毕业设计。通过分析和运行源码,你将深入了解各平台开发的技术细节和最佳实践,逐步培养起自己的项目开发和问题解决能力。此外,在求职或创业过程中,具备跨平台开发能力的大学生将更具竞争力。 其他说明: 为了确保源码资源的可运行性和易用性,特别注意了以下几点:首先,每份源码都提供了详细的运行环境和依赖说明,确保用户能够轻松搭建起开发环境;其次,源码中的注释和文档都非常完善,方便用户快速上手和理解代码;最后,我会定期更新这些源码资源,以适应各平台技术的最新发展和市场需求。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值