在key1,key2,key3上加上组合索引,速度会快一些
解决方案 »
- 一张表内数据取出特定的两行(两列)中的相同字段的数据运算该如何解决
- 新手求助 ORA-00936 标准表单查询出错
- 在线等~两个oracle库 不同表空间,一表和另一个视图数据的同步怎么实现??
- 哪位大侠知道数据库保存会话的文件在哪啊?
- oracle中用什么命令来显示数据库名列表?急~~~~~~~~~
- 为什么这条语句这么慢?
- 新手:求存储过程的入门教程
- ora-14400:插入的分区关键字未插入到任何分区, 在线等
- 菜鸟问题:Oracle9iAS是服务器,软件包里也带数据库系统吗?
- ORA-01722:无效数字。
- 怎样让 SQL Plus 在select * from table 时将该表所有的字段名完整的显示出来?
- 启动sql-plus说没有连接接口驱动程序--功能没有执行!
insert into user2.table1
select * from user1.table1 x
where not exists (select 'x' from user2.table1
where key1=x.key1
and key2=x.key2
and key3=x.key3);
insert into user2.table1
select * from user1.table1 x
where not exists (select 'x' from user2.table1
where key1=x.key1
and key2=x.key2
and key3=x.key3);
insert into user2.table1
select * from user1.table1 x
where not exists (select 'x' from user2.table1
where key1=x.key1
and key2=x.key2
and key3=x.key3);
insert into user2.table1 ( select * from user1.table1 minus select * from user2.table1)
速度会不会快呢?那种比较好?
insert into user2.table1
select * from user2.table1
minus select * from user1.table1;
insert into user2.table1
select * from user2.table1
minus select * from user1.table1;
insert into user2.table1
select * from user2.table1
minus select * from user1.table1;
你比较一下,同时你也比较一下以下的效率。insert into user2.table1
select * from user1.table1
where (key1,key2,key3) in
(select /* +rowid(table1)*/ (key1,key2,key3) from user1.table1
minus
select /* +rowid(table2)*/ (key1,key2,key3) from user2.table1
)
用not exists的效率可能高些,做做测试吧。