Insert into ultrax. Pre_forum_post_tableid
(postid)
The select data_post_id as postid
The from kernels. Csdn_discuz_topic_post
Where data_post_id not in
(select postid from ultrax. Pre_forum_post_tableid);
CodePudding user response:
The execution plan,Generally speaking, this not/not in the exists of SQL is nearly not, have the demand of the data itself has decided the impossible seconds out, what's more, the SQL without any filter conditions
CodePudding user response:
Use the EXISTS too slow to write a stored procedure cycle into executionCodePudding user response:
Insert into ultrax. Pre_forum_post_tableid(postid)
The select data_post_id as postid
The from kernels. Csdn_discuz_topic_post a,
Ultrax. Pre_forum_post_tableid b
Where a. d. ata_post_id=p. ost_id (+)
And p. ost_id is null;
CodePudding user response:
Also want to write simple SQL to perform fast? Anyway, they can accept the speed of the baiCodePudding user response:
Don't know your table data level, different order of magnitude, Oracle's execution plan is different.Your question the best line on a query plan screenshots, more clear, INSERT the merge INTO consider