Oracle 如何提高sql执行速度

数据星图 2019-09-08 10:08:25

insert into ultrax.pre_forum_post_tableid
(postid)
select data_post_id as postid
from kernels.csdn_discuz_topic_post
where data_post_id not in
(select postid from ultrax.pre_forum_post_tableid);

...全文
300 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
=PNZ=BeijingL 2019-09-11
  • 打赏
  • 举报
回复
不知道你表的数据量级,不同量级, Oracle 的执行计划是不同的.
你的问题最好上个查询行计划截图,比较清楚, INSERT INTO 可以考虑下 merge
A梦丶伊人醉 2019-09-09
  • 打赏
  • 举报
回复
还想SQL写的简单还想执行快?反正能接受的速度就行呗
qq_24424215 2019-09-09
  • 打赏
  • 举报
回复
insert into ultrax.pre_forum_post_tableid (postid) select data_post_id as postid from kernels.csdn_discuz_topic_post a, ultrax.pre_forum_post_tableid b where a.data_post_id =b.post_id(+) and b.post_id is null;
qsc1818518 2019-09-09
  • 打赏
  • 举报
回复
用EXISTS 太慢的话 写存储过程循环插入执行吧
minsic78 2019-09-08
  • 打赏
  • 举报
回复
上执行计划吧。 通常来说,这种not in/not exists的SQL快不了,有这种需求的数据本身已经决定了不可能秒出,更何况这个SQL没有任何过滤条件

17,140

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧