Oracle-仅在表中插入具有不存在的列值的行
我在Oracle中有两个相同的表(按结构相同)-table_temp和table_total。
我需要基于以下条件从table_temp中插入table_total行 - 仅在table_total中不存在的player_id值的行应插入table_total中。
Table_temp有1,12英里的记录。
我尝试了许多解决方案,但是花费了太长时间的处理,所以我停止执行。这是我的最后一次尝试,我在7个小时后停了下来:
INSERT INTO table_total
SELECT *
FROM table_temp
WHERE table_temp.player_id NOT IN (SELECT player_id FROM table_total)
什么是最佳/最快的解决方案?索引列是不可接受的解决方案...
I have two identical tables in Oracle (identical by structure) - table_temp and table_total.
I need to insert in table_total rows from table_temp based on following condition - only rows from table_temp with PLAYER_ID value which doesn't exist in table_total should be inserted in table_total.
Table_temp has 112 milions of records.
I tried many solutions but it took too long time to process so I stopped execution. This is my last try I stopped after 7 hours:
INSERT INTO table_total
SELECT *
FROM table_temp
WHERE table_temp.player_id NOT IN (SELECT player_id FROM table_total)
What is best/fastest solution for this? Indexing column is not acceptable solution...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
合并
语句:Use a
MERGE
statement: