oracle 笛卡尔联结
2014-03-31 22:01
309 查看
用scott/tiger登录。
笛卡尔连接是指在sql语句中没有写出表连接的条件或者表的连接条件不能约束两个表的连接,优化器把第一个表的每一条记录和第二个表的所有记录相连接。如果第一个表的记录数为m, 第二个表的记录数为n,则会产生m*n条记录数。
笛卡尔连接是指在sql语句中没有写出表连接的条件或者表的连接条件不能约束两个表的连接,优化器把第一个表的每一条记录和第二个表的所有记录相连接。如果第一个表的记录数为m, 第二个表的记录数为n,则会产生m*n条记录数。
SQL> set autotrace traceonly SQL> alter system flush buffer_cache; 系统已更改。 SQL> alter system flush shared_pool; 系统已更改。 SQL> select empno, ename, dname, loc from dept, emp; 已选择56行。 执行计划 ---------------------------------------------------------- Plan hash value: 2034389985 ----------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ----------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 56 | 1568 | 9 (0)| 00:00:01 | | 1 | MERGE JOIN CARTESIAN| | 56 | 1568 | 9 (0)| 00:00:01 | | 2 | TABLE ACCESS FULL | DEPT | 4 | 72 | 3 (0)| 00:00:01 | | 3 | BUFFER SORT | | 14 | 140 | 6 (0)| 00:00:01 | | 4 | TABLE ACCESS FULL | EMP | 14 | 140 | 2 (0)| 00:00:01 | ----------------------------------------------------------------------------- 统计信息 ---------------------------------------------------------- 1557 recursive calls 0 db block gets 312 consistent gets 43 physical reads 0 redo size 1876 bytes sent via SQL*Net to client 418 bytes received via SQL*Net from client 5 SQL*Net roundtrips to/from client 39 sorts (memory) 0 sorts (disk) 56 rows processed SQL>
相关文章推荐
- oracle 排序-合并联结
- Oracle的表的联结类型(内连接,外连接(左外连接,右外连接),自连接)
- oracle 散列联结 hash join
- Oracle表联结之嵌套循环
- 数据库Oracle与Mysql语法对比:联结(Join)
- oracle 反联结 NOT IN、NOT EXISTS
- Oracle(二)- 笛卡尔积造成的问题(一)
- Oracle优化——三种联结方法
- 【oracle概念】表联结方式
- Oracle优化——星型联结转换(star_transformation_enabled)
- oracle 外联结
- ORACLE 表间的联结方式
- Oracle中的半联结和反联结详解
- Oracle SQL使用笛卡尔连接、正则表达式和层次查询、union all、unpiovt 解决多列值筛选、列转行问题
- oracle 半联结 IN、EXISTS、=ANY
- Oracle优化之联结与子查询
- Oracle中的半联结和反联结详解
- oracle 嵌套循环联结
- oracle 联结方法
- Oracle常用数据字典