hash join 和 nested loop 连接的区别 oracle开发过程中如何去查看连接方式
1个回答
展开全部
通过autotrace来查看
例如
SQL> set autotrace on
SQL> select a.* from t1 a,t1 b where a.id=b.id;
no rows selected
Execution Plan
----------------------------------------------------------
Plan hash value: 1734879205
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 39 | 5 (20)| 00:00:01 |
|* 1 | HASH JOIN | | 1 | 39 | 5 (20)| 00:00:01 |
| 2 | TABLE ACCESS FULL| T1 | 1 | 26 | 2 (0)| 00:00:01 |
| 3 | TABLE ACCESS FULL| T1 | 1 | 13 | 2 (0)| 00:00:01 |
---------------------------------------------------------------------------
例如
SQL> set autotrace on
SQL> select a.* from t1 a,t1 b where a.id=b.id;
no rows selected
Execution Plan
----------------------------------------------------------
Plan hash value: 1734879205
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 39 | 5 (20)| 00:00:01 |
|* 1 | HASH JOIN | | 1 | 39 | 5 (20)| 00:00:01 |
| 2 | TABLE ACCESS FULL| T1 | 1 | 26 | 2 (0)| 00:00:01 |
| 3 | TABLE ACCESS FULL| T1 | 1 | 13 | 2 (0)| 00:00:01 |
---------------------------------------------------------------------------
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询